Merge branch 'acpica-release-fixes' into release-2.6.27
authorAndi Kleen <ak@linux.intel.com>
Thu, 21 Aug 2008 06:46:25 +0000 (08:46 +0200)
committerAndi Kleen <ak@linux.intel.com>
Thu, 21 Aug 2008 06:46:25 +0000 (08:46 +0200)
578 files changed:
Documentation/arm/Samsung-S3C24XX/GPIO.txt
Documentation/arm/Samsung-S3C24XX/Overview.txt
Documentation/filesystems/ubifs.txt
Documentation/hwmon/ibmaem
Documentation/sound/alsa/ALSA-Configuration.txt
Documentation/vm/page_migration
MAINTAINERS
arch/alpha/include/asm/8253pit.h [new file with mode: 0644]
arch/alpha/include/asm/Kbuild [new file with mode: 0644]
arch/alpha/include/asm/a.out-core.h [new file with mode: 0644]
arch/alpha/include/asm/a.out.h [new file with mode: 0644]
arch/alpha/include/asm/agp.h [new file with mode: 0644]
arch/alpha/include/asm/agp_backend.h [new file with mode: 0644]
arch/alpha/include/asm/atomic.h [new file with mode: 0644]
arch/alpha/include/asm/auxvec.h [new file with mode: 0644]
arch/alpha/include/asm/barrier.h [new file with mode: 0644]
arch/alpha/include/asm/bitops.h [new file with mode: 0644]
arch/alpha/include/asm/bug.h [new file with mode: 0644]
arch/alpha/include/asm/bugs.h [new file with mode: 0644]
arch/alpha/include/asm/byteorder.h [new file with mode: 0644]
arch/alpha/include/asm/cache.h [new file with mode: 0644]
arch/alpha/include/asm/cacheflush.h [new file with mode: 0644]
arch/alpha/include/asm/checksum.h [new file with mode: 0644]
arch/alpha/include/asm/compiler.h [new file with mode: 0644]
arch/alpha/include/asm/console.h [new file with mode: 0644]
arch/alpha/include/asm/core_apecs.h [new file with mode: 0644]
arch/alpha/include/asm/core_cia.h [new file with mode: 0644]
arch/alpha/include/asm/core_irongate.h [new file with mode: 0644]
arch/alpha/include/asm/core_lca.h [new file with mode: 0644]
arch/alpha/include/asm/core_marvel.h [new file with mode: 0644]
arch/alpha/include/asm/core_mcpcia.h [new file with mode: 0644]
arch/alpha/include/asm/core_polaris.h [new file with mode: 0644]
arch/alpha/include/asm/core_t2.h [new file with mode: 0644]
arch/alpha/include/asm/core_titan.h [new file with mode: 0644]
arch/alpha/include/asm/core_tsunami.h [new file with mode: 0644]
arch/alpha/include/asm/core_wildfire.h [new file with mode: 0644]
arch/alpha/include/asm/cputime.h [new file with mode: 0644]
arch/alpha/include/asm/current.h [new file with mode: 0644]
arch/alpha/include/asm/delay.h [new file with mode: 0644]
arch/alpha/include/asm/device.h [new file with mode: 0644]
arch/alpha/include/asm/div64.h [new file with mode: 0644]
arch/alpha/include/asm/dma-mapping.h [new file with mode: 0644]
arch/alpha/include/asm/dma.h [new file with mode: 0644]
arch/alpha/include/asm/elf.h [new file with mode: 0644]
arch/alpha/include/asm/emergency-restart.h [new file with mode: 0644]
arch/alpha/include/asm/err_common.h [new file with mode: 0644]
arch/alpha/include/asm/err_ev6.h [new file with mode: 0644]
arch/alpha/include/asm/err_ev7.h [new file with mode: 0644]
arch/alpha/include/asm/errno.h [new file with mode: 0644]
arch/alpha/include/asm/fb.h [new file with mode: 0644]
arch/alpha/include/asm/fcntl.h [new file with mode: 0644]
arch/alpha/include/asm/floppy.h [new file with mode: 0644]
arch/alpha/include/asm/fpu.h [new file with mode: 0644]
arch/alpha/include/asm/futex.h [new file with mode: 0644]
arch/alpha/include/asm/gct.h [new file with mode: 0644]
arch/alpha/include/asm/gentrap.h [new file with mode: 0644]
arch/alpha/include/asm/hardirq.h [new file with mode: 0644]
arch/alpha/include/asm/hw_irq.h [new file with mode: 0644]
arch/alpha/include/asm/hwrpb.h [new file with mode: 0644]
arch/alpha/include/asm/io.h [new file with mode: 0644]
arch/alpha/include/asm/io_trivial.h [new file with mode: 0644]
arch/alpha/include/asm/ioctl.h [new file with mode: 0644]
arch/alpha/include/asm/ioctls.h [new file with mode: 0644]
arch/alpha/include/asm/ipcbuf.h [new file with mode: 0644]
arch/alpha/include/asm/irq.h [new file with mode: 0644]
arch/alpha/include/asm/irq_regs.h [new file with mode: 0644]
arch/alpha/include/asm/jensen.h [new file with mode: 0644]
arch/alpha/include/asm/kdebug.h [new file with mode: 0644]
arch/alpha/include/asm/kmap_types.h [new file with mode: 0644]
arch/alpha/include/asm/linkage.h [new file with mode: 0644]
arch/alpha/include/asm/local.h [new file with mode: 0644]
arch/alpha/include/asm/machvec.h [new file with mode: 0644]
arch/alpha/include/asm/mc146818rtc.h [new file with mode: 0644]
arch/alpha/include/asm/md.h [new file with mode: 0644]
arch/alpha/include/asm/mman.h [new file with mode: 0644]
arch/alpha/include/asm/mmu.h [new file with mode: 0644]
arch/alpha/include/asm/mmu_context.h [new file with mode: 0644]
arch/alpha/include/asm/mmzone.h [new file with mode: 0644]
arch/alpha/include/asm/module.h [new file with mode: 0644]
arch/alpha/include/asm/msgbuf.h [new file with mode: 0644]
arch/alpha/include/asm/mutex.h [new file with mode: 0644]
arch/alpha/include/asm/page.h [new file with mode: 0644]
arch/alpha/include/asm/pal.h [new file with mode: 0644]
arch/alpha/include/asm/param.h [new file with mode: 0644]
arch/alpha/include/asm/parport.h [new file with mode: 0644]
arch/alpha/include/asm/pci.h [new file with mode: 0644]
arch/alpha/include/asm/percpu.h [new file with mode: 0644]
arch/alpha/include/asm/pgalloc.h [new file with mode: 0644]
arch/alpha/include/asm/pgtable.h [new file with mode: 0644]
arch/alpha/include/asm/poll.h [new file with mode: 0644]
arch/alpha/include/asm/posix_types.h [new file with mode: 0644]
arch/alpha/include/asm/processor.h [new file with mode: 0644]
arch/alpha/include/asm/ptrace.h [new file with mode: 0644]
arch/alpha/include/asm/reg.h [new file with mode: 0644]
arch/alpha/include/asm/regdef.h [new file with mode: 0644]
arch/alpha/include/asm/resource.h [new file with mode: 0644]
arch/alpha/include/asm/rtc.h [new file with mode: 0644]
arch/alpha/include/asm/rwsem.h [new file with mode: 0644]
arch/alpha/include/asm/scatterlist.h [new file with mode: 0644]
arch/alpha/include/asm/sections.h [new file with mode: 0644]
arch/alpha/include/asm/segment.h [new file with mode: 0644]
arch/alpha/include/asm/sembuf.h [new file with mode: 0644]
arch/alpha/include/asm/serial.h [new file with mode: 0644]
arch/alpha/include/asm/setup.h [new file with mode: 0644]
arch/alpha/include/asm/sfp-machine.h [new file with mode: 0644]
arch/alpha/include/asm/shmbuf.h [new file with mode: 0644]
arch/alpha/include/asm/shmparam.h [new file with mode: 0644]
arch/alpha/include/asm/sigcontext.h [new file with mode: 0644]
arch/alpha/include/asm/siginfo.h [new file with mode: 0644]
arch/alpha/include/asm/signal.h [new file with mode: 0644]
arch/alpha/include/asm/smp.h [new file with mode: 0644]
arch/alpha/include/asm/socket.h [new file with mode: 0644]
arch/alpha/include/asm/sockios.h [new file with mode: 0644]
arch/alpha/include/asm/spinlock.h [new file with mode: 0644]
arch/alpha/include/asm/spinlock_types.h [new file with mode: 0644]
arch/alpha/include/asm/stat.h [new file with mode: 0644]
arch/alpha/include/asm/statfs.h [new file with mode: 0644]
arch/alpha/include/asm/string.h [new file with mode: 0644]
arch/alpha/include/asm/suspend.h [new file with mode: 0644]
arch/alpha/include/asm/sysinfo.h [new file with mode: 0644]
arch/alpha/include/asm/system.h [new file with mode: 0644]
arch/alpha/include/asm/termbits.h [new file with mode: 0644]
arch/alpha/include/asm/termios.h [new file with mode: 0644]
arch/alpha/include/asm/thread_info.h [new file with mode: 0644]
arch/alpha/include/asm/timex.h [new file with mode: 0644]
arch/alpha/include/asm/tlb.h [new file with mode: 0644]
arch/alpha/include/asm/tlbflush.h [new file with mode: 0644]
arch/alpha/include/asm/topology.h [new file with mode: 0644]
arch/alpha/include/asm/types.h [new file with mode: 0644]
arch/alpha/include/asm/uaccess.h [new file with mode: 0644]
arch/alpha/include/asm/ucontext.h [new file with mode: 0644]
arch/alpha/include/asm/unaligned.h [new file with mode: 0644]
arch/alpha/include/asm/unistd.h [new file with mode: 0644]
arch/alpha/include/asm/user.h [new file with mode: 0644]
arch/alpha/include/asm/vga.h [new file with mode: 0644]
arch/alpha/include/asm/xor.h [new file with mode: 0644]
arch/arm/boot/compressed/.gitignore
arch/arm/common/dmabounce.c
arch/arm/configs/orion5x_defconfig
arch/arm/include/asm/dma-mapping.h
arch/arm/include/asm/kexec.h
arch/arm/include/asm/memory.h
arch/arm/include/asm/mtd-xip.h
arch/arm/include/asm/processor.h
arch/arm/include/asm/tlbflush.h
arch/arm/include/asm/unistd.h
arch/arm/kernel/.gitignore [new file with mode: 0644]
arch/arm/kernel/calls.S
arch/arm/kernel/machine_kexec.c
arch/arm/kernel/setup.c
arch/arm/kernel/traps.c
arch/arm/mach-footbridge/cats-pci.c
arch/arm/mach-integrator/cpu.c
arch/arm/mach-integrator/include/mach/platform.h
arch/arm/mach-kirkwood/common.c
arch/arm/mach-kirkwood/common.h
arch/arm/mach-kirkwood/include/mach/kirkwood.h
arch/arm/mach-kirkwood/irq.c
arch/arm/mach-kirkwood/pcie.c
arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
arch/arm/mach-kirkwood/rd88f6281-setup.c
arch/arm/mach-lh7a40x/include/mach/ssp.h
arch/arm/mach-lh7a40x/lcd-panel.h
arch/arm/mach-loki/common.c
arch/arm/mach-loki/irq.c
arch/arm/mach-mv78xx0/common.c
arch/arm/mach-mv78xx0/irq.c
arch/arm/mach-mv78xx0/pcie.c
arch/arm/mach-orion5x/common.c
arch/arm/mach-orion5x/common.h
arch/arm/mach-orion5x/db88f5281-setup.c
arch/arm/mach-orion5x/include/mach/orion5x.h
arch/arm/mach-orion5x/irq.c
arch/arm/mach-orion5x/kurobox_pro-setup.c
arch/arm/mach-orion5x/mss2-setup.c
arch/arm/mach-orion5x/mv2120-setup.c
arch/arm/mach-orion5x/pci.c
arch/arm/mach-orion5x/rd88f5182-setup.c
arch/arm/mach-orion5x/ts209-setup.c
arch/arm/mach-orion5x/ts409-setup.c
arch/arm/mach-orion5x/ts78xx-setup.c
arch/arm/mach-pxa/include/mach/mtd-xip.h
arch/arm/mach-pxa/include/mach/poodle.h
arch/arm/mach-pxa/include/mach/pxafb.h
arch/arm/mach-s3c2410/include/mach/regs-clock.h
arch/arm/mach-s3c2410/include/mach/regs-gpio.h
arch/arm/mach-s3c2410/include/mach/regs-irq.h
arch/arm/mach-s3c2410/include/mach/regs-lcd.h
arch/arm/mach-s3c2410/include/mach/regs-mem.h
arch/arm/mach-s3c2410/mach-bast.c
arch/arm/mach-s3c2410/mach-smdk2410.c
arch/arm/mach-s3c2410/mach-vr1000.c
arch/arm/mach-s3c2412/mach-jive.c
arch/arm/mach-s3c2440/mach-anubis.c
arch/arm/mach-s3c2440/mach-osiris.c
arch/arm/mach-sa1100/cpu-sa1110.c
arch/arm/mach-sa1100/include/mach/mtd-xip.h
arch/arm/mm/cache-feroceon-l2.c
arch/arm/mm/mmu.c
arch/arm/mm/proc-arm940.S
arch/arm/mm/proc-arm946.S
arch/arm/plat-omap/include/mach/memory.h
arch/arm/plat-orion/include/plat/cache-feroceon-l2.h [new file with mode: 0644]
arch/arm/plat-orion/include/plat/ehci-orion.h [new file with mode: 0644]
arch/arm/plat-orion/include/plat/irq.h [new file with mode: 0644]
arch/arm/plat-orion/include/plat/mv_xor.h [new file with mode: 0644]
arch/arm/plat-orion/include/plat/orion_nand.h [new file with mode: 0644]
arch/arm/plat-orion/include/plat/pcie.h [new file with mode: 0644]
arch/arm/plat-orion/include/plat/time.h [new file with mode: 0644]
arch/arm/plat-orion/irq.c
arch/arm/plat-orion/pcie.c
arch/arm/plat-s3c24xx/cpu.c
arch/arm/tools/mach-types
arch/blackfin/Kconfig
arch/blackfin/configs/BlackStamp_defconfig [new file with mode: 0644]
arch/blackfin/configs/TCM-BF537_defconfig [new file with mode: 0644]
arch/blackfin/kernel/cplb-mpu/cacheinit.c
arch/blackfin/kernel/cplb-nompu/cacheinit.c
arch/blackfin/kernel/cplb-nompu/cplbinit.c
arch/blackfin/kernel/setup.c
arch/blackfin/kernel/traps.c
arch/blackfin/kernel/vmlinux.lds.S
arch/blackfin/lib/ins.S
arch/blackfin/mach-bf527/boards/cm_bf527.c
arch/blackfin/mach-bf527/boards/ezkit.c
arch/blackfin/mach-bf527/head.S
arch/blackfin/mach-bf527/ints-priority.c
arch/blackfin/mach-bf533/boards/H8606.c
arch/blackfin/mach-bf533/boards/Kconfig
arch/blackfin/mach-bf533/boards/Makefile
arch/blackfin/mach-bf533/boards/blackstamp.c [new file with mode: 0644]
arch/blackfin/mach-bf533/boards/cm_bf533.c
arch/blackfin/mach-bf533/boards/ezkit.c
arch/blackfin/mach-bf533/boards/stamp.c
arch/blackfin/mach-bf533/head.S
arch/blackfin/mach-bf533/ints-priority.c
arch/blackfin/mach-bf537/boards/Kconfig
arch/blackfin/mach-bf537/boards/Makefile
arch/blackfin/mach-bf537/boards/cm_bf537.c
arch/blackfin/mach-bf537/boards/generic_board.c
arch/blackfin/mach-bf537/boards/minotaur.c
arch/blackfin/mach-bf537/boards/pnav10.c
arch/blackfin/mach-bf537/boards/stamp.c
arch/blackfin/mach-bf537/boards/tcm_bf537.c [new file with mode: 0644]
arch/blackfin/mach-bf537/head.S
arch/blackfin/mach-bf537/ints-priority.c
arch/blackfin/mach-bf548/boards/cm_bf548.c
arch/blackfin/mach-bf548/boards/ezkit.c
arch/blackfin/mach-bf548/head.S
arch/blackfin/mach-bf548/ints-priority.c
arch/blackfin/mach-bf561/boards/cm_bf561.c
arch/blackfin/mach-bf561/boards/ezkit.c
arch/blackfin/mach-bf561/head.S
arch/blackfin/mach-bf561/ints-priority.c
arch/blackfin/mach-common/Makefile
arch/blackfin/mach-common/arch_checks.c
arch/blackfin/mach-common/cache.S
arch/blackfin/mach-common/cacheinit.S [deleted file]
arch/blackfin/mach-common/dpmc_modes.S
arch/blackfin/mach-common/entry.S
arch/blackfin/mach-common/head.S [new file with mode: 0644]
arch/blackfin/mach-common/ints-priority.c
arch/blackfin/mach-common/lock.S
arch/blackfin/mach-common/pm.c
arch/blackfin/mm/blackfin_sram.c
arch/ia64/include/asm/kexec.h
arch/powerpc/include/asm/kexec.h
arch/powerpc/kernel/machine_kexec_32.c
arch/s390/include/asm/kexec.h
arch/sh/include/asm/kexec.h
arch/x86/Kconfig
arch/x86/boot/boot.h
arch/x86/boot/cpu.c
arch/x86/boot/cpucheck.c
arch/x86/boot/main.c
arch/x86/kernel/acpi/boot.c
arch/x86/kernel/acpi/sleep.c
arch/x86/kernel/amd_iommu.c
arch/x86/kernel/amd_iommu_init.c
arch/x86/kernel/apic_32.c
arch/x86/kernel/apic_64.c
arch/x86/kernel/cpu/perfctr-watchdog.c
arch/x86/kernel/genx2apic_uv_x.c
arch/x86/kernel/head64.c
arch/x86/kernel/hpet.c
arch/x86/kernel/machine_kexec_32.c
arch/x86/kernel/mfgpt_32.c
arch/x86/kernel/msr.c
arch/x86/kernel/nmi.c
arch/x86/kernel/process_32.c
arch/x86/kernel/process_64.c
arch/x86/kernel/relocate_kernel_32.S
arch/x86/kernel/setup.c
arch/x86/kernel/signal_64.c
arch/x86/kernel/smpboot.c
arch/x86/kernel/smpcommon.c
arch/x86/kernel/traps_64.c
arch/x86/kernel/visws_quirks.c
arch/x86/kernel/vmlinux_32.lds.S
arch/x86/mm/init_64.c
arch/x86/mm/ioremap.c
arch/x86/mm/pageattr-test.c
arch/x86/mm/pageattr.c
arch/x86/mm/srat_32.c
arch/x86/pci/mmconfig-shared.c
drivers/acpi/dock.c
drivers/acpi/ec.c
drivers/acpi/pci_link.c
drivers/acpi/processor_core.c
drivers/acpi/processor_idle.c
drivers/acpi/processor_perflib.c
drivers/acpi/wmi.c
drivers/char/pcmcia/ipwireless/tty.c
drivers/char/synclink_gt.c
drivers/char/tty_io.c
drivers/char/vt.c
drivers/char/vt_ioctl.c
drivers/char/xilinx_hwicap/xilinx_hwicap.c
drivers/cpuidle/governors/ladder.c
drivers/cpuidle/governors/menu.c
drivers/dma/mv_xor.c
drivers/hid/usbhid/hid-quirks.c
drivers/hwmon/Kconfig
drivers/hwmon/Makefile
drivers/hwmon/abituguru3.c
drivers/hwmon/adcxx.c [new file with mode: 0644]
drivers/hwmon/applesmc.c
drivers/hwmon/coretemp.c
drivers/hwmon/hwmon-vid.c
drivers/hwmon/i5k_amb.c
drivers/hwmon/ibmaem.c
drivers/hwmon/w83791d.c
drivers/input/evdev.c
drivers/input/joystick/xpad.c
drivers/input/keyboard/gpio_keys.c
drivers/input/mouse/Kconfig
drivers/input/mouse/Makefile
drivers/input/mouse/bcm5974.c [new file with mode: 0644]
drivers/input/serio/i8042-x86ia64io.h
drivers/input/serio/xilinx_ps2.c
drivers/input/touchscreen/Kconfig
drivers/md/md.c
drivers/md/raid10.c
drivers/md/raid5.c
drivers/misc/acer-wmi.c
drivers/mtd/nand/orion_nand.c
drivers/pcmcia/pxa2xx_palmtx.c
drivers/serial/Kconfig
drivers/spi/spi.c
drivers/usb/host/ehci-orion.c
drivers/video/fsl-diu-fb.c
drivers/video/pxafb.c
drivers/watchdog/s3c2410_wdt.c
fs/cifs/cifsfs.c
fs/cifs/inode.c
fs/inode.c
fs/omfs/bitmap.c
fs/omfs/file.c
fs/omfs/inode.c
fs/ubifs/budget.c
fs/ubifs/commit.c
fs/ubifs/debug.c
fs/ubifs/debug.h
fs/ubifs/dir.c
fs/ubifs/file.c
fs/ubifs/find.c
fs/ubifs/io.c
fs/ubifs/journal.c
fs/ubifs/log.c
fs/ubifs/misc.h
fs/ubifs/orphan.c
fs/ubifs/super.c
fs/ubifs/tnc_commit.c
fs/ubifs/ubifs-media.h
fs/ubifs/ubifs.h
fs/ubifs/xattr.c
include/asm-alpha/8253pit.h [deleted file]
include/asm-alpha/Kbuild [deleted file]
include/asm-alpha/a.out-core.h [deleted file]
include/asm-alpha/a.out.h [deleted file]
include/asm-alpha/agp.h [deleted file]
include/asm-alpha/agp_backend.h [deleted file]
include/asm-alpha/atomic.h [deleted file]
include/asm-alpha/auxvec.h [deleted file]
include/asm-alpha/barrier.h [deleted file]
include/asm-alpha/bitops.h [deleted file]
include/asm-alpha/bug.h [deleted file]
include/asm-alpha/bugs.h [deleted file]
include/asm-alpha/byteorder.h [deleted file]
include/asm-alpha/cache.h [deleted file]
include/asm-alpha/cacheflush.h [deleted file]
include/asm-alpha/checksum.h [deleted file]
include/asm-alpha/compiler.h [deleted file]
include/asm-alpha/console.h [deleted file]
include/asm-alpha/core_apecs.h [deleted file]
include/asm-alpha/core_cia.h [deleted file]
include/asm-alpha/core_irongate.h [deleted file]
include/asm-alpha/core_lca.h [deleted file]
include/asm-alpha/core_marvel.h [deleted file]
include/asm-alpha/core_mcpcia.h [deleted file]
include/asm-alpha/core_polaris.h [deleted file]
include/asm-alpha/core_t2.h [deleted file]
include/asm-alpha/core_titan.h [deleted file]
include/asm-alpha/core_tsunami.h [deleted file]
include/asm-alpha/core_wildfire.h [deleted file]
include/asm-alpha/cputime.h [deleted file]
include/asm-alpha/current.h [deleted file]
include/asm-alpha/delay.h [deleted file]
include/asm-alpha/device.h [deleted file]
include/asm-alpha/div64.h [deleted file]
include/asm-alpha/dma-mapping.h [deleted file]
include/asm-alpha/dma.h [deleted file]
include/asm-alpha/elf.h [deleted file]
include/asm-alpha/emergency-restart.h [deleted file]
include/asm-alpha/err_common.h [deleted file]
include/asm-alpha/err_ev6.h [deleted file]
include/asm-alpha/err_ev7.h [deleted file]
include/asm-alpha/errno.h [deleted file]
include/asm-alpha/fb.h [deleted file]
include/asm-alpha/fcntl.h [deleted file]
include/asm-alpha/floppy.h [deleted file]
include/asm-alpha/fpu.h [deleted file]
include/asm-alpha/futex.h [deleted file]
include/asm-alpha/gct.h [deleted file]
include/asm-alpha/gentrap.h [deleted file]
include/asm-alpha/hardirq.h [deleted file]
include/asm-alpha/hw_irq.h [deleted file]
include/asm-alpha/hwrpb.h [deleted file]
include/asm-alpha/io.h [deleted file]
include/asm-alpha/io_trivial.h [deleted file]
include/asm-alpha/ioctl.h [deleted file]
include/asm-alpha/ioctls.h [deleted file]
include/asm-alpha/ipcbuf.h [deleted file]
include/asm-alpha/irq.h [deleted file]
include/asm-alpha/irq_regs.h [deleted file]
include/asm-alpha/jensen.h [deleted file]
include/asm-alpha/kdebug.h [deleted file]
include/asm-alpha/kmap_types.h [deleted file]
include/asm-alpha/linkage.h [deleted file]
include/asm-alpha/local.h [deleted file]
include/asm-alpha/machvec.h [deleted file]
include/asm-alpha/mc146818rtc.h [deleted file]
include/asm-alpha/md.h [deleted file]
include/asm-alpha/mman.h [deleted file]
include/asm-alpha/mmu.h [deleted file]
include/asm-alpha/mmu_context.h [deleted file]
include/asm-alpha/mmzone.h [deleted file]
include/asm-alpha/module.h [deleted file]
include/asm-alpha/msgbuf.h [deleted file]
include/asm-alpha/mutex.h [deleted file]
include/asm-alpha/page.h [deleted file]
include/asm-alpha/pal.h [deleted file]
include/asm-alpha/param.h [deleted file]
include/asm-alpha/parport.h [deleted file]
include/asm-alpha/pci.h [deleted file]
include/asm-alpha/percpu.h [deleted file]
include/asm-alpha/pgalloc.h [deleted file]
include/asm-alpha/pgtable.h [deleted file]
include/asm-alpha/poll.h [deleted file]
include/asm-alpha/posix_types.h [deleted file]
include/asm-alpha/processor.h [deleted file]
include/asm-alpha/ptrace.h [deleted file]
include/asm-alpha/reg.h [deleted file]
include/asm-alpha/regdef.h [deleted file]
include/asm-alpha/resource.h [deleted file]
include/asm-alpha/rtc.h [deleted file]
include/asm-alpha/rwsem.h [deleted file]
include/asm-alpha/scatterlist.h [deleted file]
include/asm-alpha/sections.h [deleted file]
include/asm-alpha/segment.h [deleted file]
include/asm-alpha/sembuf.h [deleted file]
include/asm-alpha/serial.h [deleted file]
include/asm-alpha/setup.h [deleted file]
include/asm-alpha/sfp-machine.h [deleted file]
include/asm-alpha/shmbuf.h [deleted file]
include/asm-alpha/shmparam.h [deleted file]
include/asm-alpha/sigcontext.h [deleted file]
include/asm-alpha/siginfo.h [deleted file]
include/asm-alpha/signal.h [deleted file]
include/asm-alpha/smp.h [deleted file]
include/asm-alpha/socket.h [deleted file]
include/asm-alpha/sockios.h [deleted file]
include/asm-alpha/spinlock.h [deleted file]
include/asm-alpha/spinlock_types.h [deleted file]
include/asm-alpha/stat.h [deleted file]
include/asm-alpha/statfs.h [deleted file]
include/asm-alpha/string.h [deleted file]
include/asm-alpha/suspend.h [deleted file]
include/asm-alpha/sysinfo.h [deleted file]
include/asm-alpha/system.h [deleted file]
include/asm-alpha/termbits.h [deleted file]
include/asm-alpha/termios.h [deleted file]
include/asm-alpha/thread_info.h [deleted file]
include/asm-alpha/timex.h [deleted file]
include/asm-alpha/tlb.h [deleted file]
include/asm-alpha/tlbflush.h [deleted file]
include/asm-alpha/topology.h [deleted file]
include/asm-alpha/types.h [deleted file]
include/asm-alpha/uaccess.h [deleted file]
include/asm-alpha/ucontext.h [deleted file]
include/asm-alpha/unaligned.h [deleted file]
include/asm-alpha/unistd.h [deleted file]
include/asm-alpha/user.h [deleted file]
include/asm-alpha/vga.h [deleted file]
include/asm-alpha/xor.h [deleted file]
include/asm-arm/plat-orion/cache-feroceon-l2.h [deleted file]
include/asm-arm/plat-orion/ehci-orion.h [deleted file]
include/asm-arm/plat-orion/irq.h [deleted file]
include/asm-arm/plat-orion/mv_xor.h [deleted file]
include/asm-arm/plat-orion/orion_nand.h [deleted file]
include/asm-arm/plat-orion/pcie.h [deleted file]
include/asm-arm/plat-orion/time.h [deleted file]
include/asm-arm/plat-s3c/regs-nand.h
include/asm-arm/plat-s3c/regs-timer.h
include/asm-arm/plat-s3c/regs-watchdog.h
include/asm-arm/plat-s3c24xx/s3c2410.h
include/asm-blackfin/Kbuild
include/asm-blackfin/bfin-global.h
include/asm-blackfin/dpmc.h
include/asm-blackfin/fixed_code.h
include/asm-blackfin/mach-bf527/mem_map.h
include/asm-blackfin/mach-bf533/mem_init.h
include/asm-blackfin/mach-bf533/mem_map.h
include/asm-blackfin/mach-bf537/mem_map.h
include/asm-blackfin/mach-common/cdef_LPBlackfin.h
include/asm-blackfin/unistd.h
include/asm-mips/kexec.h
include/asm-x86/amd_iommu_types.h
include/asm-x86/geode.h
include/asm-x86/i387.h
include/asm-x86/io.h
include/asm-x86/kexec.h
include/asm-x86/mman.h
include/asm-x86/mmzone_32.h
include/asm-x86/pgtable_64.h
include/asm-x86/processor.h
include/asm-x86/spinlock.h
include/linux/Kbuild
include/linux/capability.h
include/linux/completion.h
include/linux/ftrace.h
include/linux/ivtv.h
include/linux/ivtvfb.h
include/linux/kexec.h
include/linux/mm.h
include/linux/mm_types.h
include/linux/reboot.h
include/linux/security.h
include/linux/suspend.h
include/linux/tty.h
include/linux/tty_driver.h
include/linux/videodev2.h
include/linux/vmalloc.h
include/linux/vt_kern.h
init/Kconfig
kernel/capability.c
kernel/kexec.c
kernel/lockdep.c
kernel/lockdep_internals.h
kernel/lockdep_proc.c
kernel/ptrace.c
kernel/sched.c
kernel/sched_rt.c
kernel/spinlock.c
kernel/sys.c
lib/Kconfig.debug
mm/bootmem.c
mm/oom_kill.c
security/capability.c
security/commoncap.c
security/root_plug.c
security/security.c
security/selinux/hooks.c
security/smack/smack_lsm.c
sound/pci/Kconfig
sound/pci/oxygen/virtuoso.c
sound/soc/codecs/wm8990.c
sound/soc/codecs/wm8990.h

index b5d20c0..ea7ccfc 100644 (file)
@@ -13,6 +13,21 @@ Introduction
   data-sheet/users manual to find out the complete list.
 
 
+GPIOLIB
+-------
+
+  With the event of the GPIOLIB in drivers/gpio, support for some
+  of the GPIO functions such as reading and writing a pin will
+  be removed in favour of this common access method.
+
+  Once all the extant drivers have been converted, the functions
+  listed below will be removed (they may be marked as __deprecated
+  in the near future).
+
+  - s3c2410_gpio_getpin
+  - s3c2410_gpio_setpin
+
+
 Headers
 -------
 
index 014a8ec..cff6227 100644 (file)
@@ -8,9 +8,10 @@ Introduction
 
   The Samsung S3C24XX range of ARM9 System-on-Chip CPUs are supported
   by the 's3c2410' architecture of ARM Linux. Currently the S3C2410,
-  S3C2412, S3C2413, S3C2440 and S3C2442 devices are supported.
+  S3C2412, S3C2413, S3C2440, S3C2442 and S3C2443 devices are supported.
+
+  Support for the S3C2400 and S3C24A0 series are in progress.
 
-  Support for the S3C2400 series is in progress.
 
 Configuration
 -------------
@@ -38,6 +39,22 @@ Layout
   Register, kernel and platform data definitions are held in the
   arch/arm/mach-s3c2410 directory./include/mach
 
+arch/arm/plat-s3c24xx:
+
+  Files in here are either common to all the s3c24xx family,
+  or are common to only some of them with names to indicate this
+  status. The files that are not common to all are generally named
+  with the initial cpu they support in the series to ensure a short
+  name without any possibility of confusion with newer devices.
+
+  As an example, initially s3c244x would cover s3c2440 and s3c2442, but
+  with the s3c2443 which does not share many of the same drivers in
+  this directory, the name becomes invalid. We stick to s3c2440-<x>
+  to indicate a driver that is s3c2440 and s3c2442 compatible.
+
+  This does mean that to find the status of any given SoC, a number
+  of directories may need to be searched.
+
 
 Machines
 --------
@@ -159,6 +176,17 @@ NAND
   For more information see Documentation/arm/Samsung-S3C24XX/NAND.txt
 
 
+SD/MMC
+------
+
+  The SD/MMC hardware pre S3C2443 is supported in the current
+  kernel, the driver is drivers/mmc/host/s3cmci.c and supports
+  1 and 4 bit SD or MMC cards.
+
+  The SDIO behaviour of this driver has not been fully tested. There is no
+  current support for hardware SDIO interrupts.
+
+
 Serial
 ------
 
@@ -178,6 +206,9 @@ GPIO
   The core contains support for manipulating the GPIO, see the
   documentation in GPIO.txt in the same directory as this file.
 
+  Newer kernels carry GPIOLIB, and support is being moved towards
+  this with some of the older support in line to be removed.
+
 
 Clock Management
 ----------------
index 540e9e7..6a0d70a 100644 (file)
@@ -57,7 +57,7 @@ Similarly to JFFS2, UBIFS supports on-the-flight compression which makes
 it possible to fit quite a lot of data to the flash.
 
 Similarly to JFFS2, UBIFS is tolerant of unclean reboots and power-cuts.
-It does not need stuff like ckfs.ext2. UBIFS automatically replays its
+It does not need stuff like fsck.ext2. UBIFS automatically replays its
 journal and recovers from crashes, ensuring that the on-flash data
 structures are consistent.
 
index 2fefaf5..e98bdfe 100644 (file)
@@ -1,8 +1,11 @@
 Kernel driver ibmaem
 ======================
 
+This driver talks to the IBM Systems Director Active Energy Manager, known
+henceforth as AEM.
+
 Supported systems:
-  * Any recent IBM System X server with Active Energy Manager support.
+  * Any recent IBM System X server with AEM support.
     This includes the x3350, x3550, x3650, x3655, x3755, x3850 M2,
     x3950 M2, and certain HS2x/LS2x/QS2x blades.  The IPMI host interface
     driver ("ipmi-si") needs to be loaded for this driver to do anything.
@@ -14,24 +17,22 @@ Author: Darrick J. Wong
 Description
 -----------
 
-This driver implements sensor reading support for the energy and power
-meters available on various IBM System X hardware through the BMC.  All
-sensor banks will be exported as platform devices; this driver can talk
-to both v1 and v2 interfaces.  This driver is completely separate from the
-older ibmpex driver.
+This driver implements sensor reading support for the energy and power meters
+available on various IBM System X hardware through the BMC.  All sensor banks
+will be exported as platform devices; this driver can talk to both v1 and v2
+interfaces.  This driver is completely separate from the older ibmpex driver.
 
-The v1 AEM interface has a simple set of features to monitor energy use.
-There is a register that displays an estimate of raw energy consumption
-since the last BMC reset, and a power sensor that returns average power
-use over a configurable interval.
+The v1 AEM interface has a simple set of features to monitor energy use.  There
+is a register that displays an estimate of raw energy consumption since the
+last BMC reset, and a power sensor that returns average power use over a
+configurable interval.
 
-The v2 AEM interface is a bit more sophisticated, being able to present
-a wider range of energy and power use registers, the power cap as
-set by the AEM software, and temperature sensors.
+The v2 AEM interface is a bit more sophisticated, being able to present a wider
+range of energy and power use registers, the power cap as set by the AEM
+software, and temperature sensors.
 
 Special Features
 ----------------
 
-The "power_cap" value displays the current system power cap, as set by
-the Active Energy Manager software.  Setting the power cap from the host
-is not currently supported.
+The "power_cap" value displays the current system power cap, as set by the AEM
+software.  Setting the power cap from the host is not currently supported.
index 6f6d117..b117e42 100644 (file)
@@ -1144,8 +1144,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
 
     This module supports autoprobe and multiple cards.
 
-    Power management is _not_ supported.
-
   Module snd-ice1712
   ------------------
 
@@ -1628,8 +1626,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
 
     This module supports autoprobe and multiple cards.
 
-    Power management is _not_ supported.
-
   Module snd-pcsp
   -----------------
 
@@ -2081,13 +2077,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
   Module snd-virtuoso
   -------------------
 
-    Module for sound cards based on the Asus AV200 chip, i.e.,
-    Xonar D2 and Xonar D2X.
+    Module for sound cards based on the Asus AV100/AV200 chips,
+    i.e., Xonar D1, DX, D2 and D2X.
 
     This module supports autoprobe and multiple cards.
 
-    Power management is _not_ supported.
-
   Module snd-vx222
   ----------------
 
index 99f89aa..d5fdfd3 100644 (file)
@@ -18,10 +18,11 @@ migrate_pages function call takes two sets of nodes and moves pages of a
 process that are located on the from nodes to the destination nodes.
 Page migration functions are provided by the numactl package by Andi Kleen
 (a version later than 0.9.3 is required. Get it from
-ftp://ftp.suse.com/pub/people/ak). numactl provided libnuma which
-provides an interface similar to other numa functionality for page migration.
-cat /proc/<pid>/numa_maps allows an easy review of where the pages of
-a process are located. See also the numa_maps manpage in the numactl package.
+ftp://oss.sgi.com/www/projects/libnuma/download/). numactl provides libnuma
+which provides an interface similar to other numa functionality for page
+migration.  cat /proc/<pid>/numa_maps allows an easy review of where the
+pages of a process are located. See also the numa_maps documentation in the
+proc(5) man page.
 
 Manual migration is useful if for example the scheduler has relocated
 a process to a processor on a distant node. A batch scheduler or an
index 4c5e9fe..663485b 100644 (file)
@@ -175,12 +175,18 @@ M:        bcrl@kvack.org
 L:     linux-aio@kvack.org
 S:     Supported
 
-ABIT UGURU HARDWARE MONITOR DRIVER
+ABIT UGURU 1,2 HARDWARE MONITOR DRIVER
 P:     Hans de Goede
 M:     j.w.r.degoede@hhs.nl
 L:     lm-sensors@lm-sensors.org
 S:     Maintained
 
+ABIT UGURU 3 HARDWARE MONITOR DRIVER
+P:     Alistair John Strachan
+M:     alistair@devzero.co.uk
+L:     lm-sensors@lm-sensors.org
+S:     Maintained
+
 ACENIC DRIVER
 P:     Jes Sorensen
 M:     jes@trained-monkey.org
@@ -3748,6 +3754,16 @@ L:       linux-visws-devel@lists.sf.net
 W:     http://linux-visws.sf.net
 S:     Maintained for 2.6.
 
+SGI GRU DRIVER
+P:     Jack Steiner
+M:     steiner@sgi.com
+S:     Maintained
+
+SGI XP/XPC/XPNET DRIVER
+P:     Dean Nelson
+M:     dcn@sgi.com
+S:     Maintained
+
 SIMTEC EB110ATX (Chalice CATS)
 P:     Ben Dooks
 P:     Vincent Sanders
diff --git a/arch/alpha/include/asm/8253pit.h b/arch/alpha/include/asm/8253pit.h
new file mode 100644 (file)
index 0000000..fef5c14
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+ * 8253/8254 Programmable Interval Timer
+ */
+
+#ifndef _8253PIT_H
+#define _8253PIT_H
+
+#define PIT_TICK_RATE  1193180UL
+
+#endif
diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild
new file mode 100644 (file)
index 0000000..b7c8f18
--- /dev/null
@@ -0,0 +1,11 @@
+include include/asm-generic/Kbuild.asm
+
+header-y += gentrap.h
+header-y += regdef.h
+header-y += pal.h
+header-y += reg.h
+
+unifdef-y += console.h
+unifdef-y += fpu.h
+unifdef-y += sysinfo.h
+unifdef-y += compiler.h
diff --git a/arch/alpha/include/asm/a.out-core.h b/arch/alpha/include/asm/a.out-core.h
new file mode 100644 (file)
index 0000000..9e33e92
--- /dev/null
@@ -0,0 +1,80 @@
+/* a.out coredump register dumper
+ *
+ * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public Licence
+ * as published by the Free Software Foundation; either version
+ * 2 of the Licence, or (at your option) any later version.
+ */
+
+#ifndef _ASM_A_OUT_CORE_H
+#define _ASM_A_OUT_CORE_H
+
+#ifdef __KERNEL__
+
+#include <linux/user.h>
+
+/*
+ * Fill in the user structure for an ECOFF core dump.
+ */
+static inline void aout_dump_thread(struct pt_regs *pt, struct user *dump)
+{
+       /* switch stack follows right below pt_regs: */
+       struct switch_stack * sw = ((struct switch_stack *) pt) - 1;
+
+       dump->magic = CMAGIC;
+       dump->start_code  = current->mm->start_code;
+       dump->start_data  = current->mm->start_data;
+       dump->start_stack = rdusp() & ~(PAGE_SIZE - 1);
+       dump->u_tsize = ((current->mm->end_code - dump->start_code)
+                        >> PAGE_SHIFT);
+       dump->u_dsize = ((current->mm->brk + PAGE_SIZE-1 - dump->start_data)
+                        >> PAGE_SHIFT);
+       dump->u_ssize = (current->mm->start_stack - dump->start_stack
+                        + PAGE_SIZE-1) >> PAGE_SHIFT;
+
+       /*
+        * We store the registers in an order/format that is
+        * compatible with DEC Unix/OSF/1 as this makes life easier
+        * for gdb.
+        */
+       dump->regs[EF_V0]  = pt->r0;
+       dump->regs[EF_T0]  = pt->r1;
+       dump->regs[EF_T1]  = pt->r2;
+       dump->regs[EF_T2]  = pt->r3;
+       dump->regs[EF_T3]  = pt->r4;
+       dump->regs[EF_T4]  = pt->r5;
+       dump->regs[EF_T5]  = pt->r6;
+       dump->regs[EF_T6]  = pt->r7;
+       dump->regs[EF_T7]  = pt->r8;
+       dump->regs[EF_S0]  = sw->r9;
+       dump->regs[EF_S1]  = sw->r10;
+       dump->regs[EF_S2]  = sw->r11;
+       dump->regs[EF_S3]  = sw->r12;
+       dump->regs[EF_S4]  = sw->r13;
+       dump->regs[EF_S5]  = sw->r14;
+       dump->regs[EF_S6]  = sw->r15;
+       dump->regs[EF_A3]  = pt->r19;
+       dump->regs[EF_A4]  = pt->r20;
+       dump->regs[EF_A5]  = pt->r21;
+       dump->regs[EF_T8]  = pt->r22;
+       dump->regs[EF_T9]  = pt->r23;
+       dump->regs[EF_T10] = pt->r24;
+       dump->regs[EF_T11] = pt->r25;
+       dump->regs[EF_RA]  = pt->r26;
+       dump->regs[EF_T12] = pt->r27;
+       dump->regs[EF_AT]  = pt->r28;
+       dump->regs[EF_SP]  = rdusp();
+       dump->regs[EF_PS]  = pt->ps;
+       dump->regs[EF_PC]  = pt->pc;
+       dump->regs[EF_GP]  = pt->gp;
+       dump->regs[EF_A0]  = pt->r16;
+       dump->regs[EF_A1]  = pt->r17;
+       dump->regs[EF_A2]  = pt->r18;
+       memcpy((char *)dump->regs + EF_SIZE, sw->fp, 32 * 8);
+}
+
+#endif /* __KERNEL__ */
+#endif /* _ASM_A_OUT_CORE_H */
diff --git a/arch/alpha/include/asm/a.out.h b/arch/alpha/include/asm/a.out.h
new file mode 100644 (file)
index 0000000..02ce847
--- /dev/null
@@ -0,0 +1,102 @@
+#ifndef __ALPHA_A_OUT_H__
+#define __ALPHA_A_OUT_H__
+
+#include <linux/types.h>
+
+/*
+ * OSF/1 ECOFF header structs.  ECOFF files consist of:
+ *     - a file header (struct filehdr),
+ *     - an a.out header (struct aouthdr),
+ *     - one or more section headers (struct scnhdr). 
+ *       The filhdr's "f_nscns" field contains the
+ *       number of section headers.
+ */
+
+struct filehdr
+{
+       /* OSF/1 "file" header */
+       __u16 f_magic, f_nscns;
+       __u32 f_timdat;
+       __u64 f_symptr;
+       __u32 f_nsyms;
+       __u16 f_opthdr, f_flags;
+};
+
+struct aouthdr
+{
+       __u64 info;             /* after that it looks quite normal.. */
+       __u64 tsize;
+       __u64 dsize;
+       __u64 bsize;
+       __u64 entry;
+       __u64 text_start;       /* with a few additions that actually make sense */
+       __u64 data_start;
+       __u64 bss_start;
+       __u32 gprmask, fprmask; /* bitmask of general & floating point regs used in binary */
+       __u64 gpvalue;
+};
+
+struct scnhdr
+{
+       char    s_name[8];
+       __u64   s_paddr;
+       __u64   s_vaddr;
+       __u64   s_size;
+       __u64   s_scnptr;
+       __u64   s_relptr;
+       __u64   s_lnnoptr;
+       __u16   s_nreloc;
+       __u16   s_nlnno;
+       __u32   s_flags;
+};
+
+struct exec
+{
+       /* OSF/1 "file" header */
+       struct filehdr          fh;
+       struct aouthdr          ah;
+};
+
+/*
+ * Define's so that the kernel exec code can access the a.out header
+ * fields...
+ */
+#define        a_info          ah.info
+#define        a_text          ah.tsize
+#define a_data         ah.dsize
+#define a_bss          ah.bsize
+#define a_entry                ah.entry
+#define a_textstart    ah.text_start
+#define        a_datastart     ah.data_start
+#define        a_bssstart      ah.bss_start
+#define        a_gprmask       ah.gprmask
+#define a_fprmask      ah.fprmask
+#define a_gpvalue      ah.gpvalue
+
+#define N_TXTADDR(x) ((x).a_textstart)
+#define N_DATADDR(x) ((x).a_datastart)
+#define N_BSSADDR(x) ((x).a_bssstart)
+#define N_DRSIZE(x) 0
+#define N_TRSIZE(x) 0
+#define N_SYMSIZE(x) 0
+
+#define AOUTHSZ                sizeof(struct aouthdr)
+#define SCNHSZ         sizeof(struct scnhdr)
+#define SCNROUND       16
+
+#define N_TXTOFF(x) \
+  ((long) N_MAGIC(x) == ZMAGIC ? 0 : \
+   (sizeof(struct exec) + (x).fh.f_nscns*SCNHSZ + SCNROUND - 1) & ~(SCNROUND - 1))
+
+#ifdef __KERNEL__
+
+/* Assume that start addresses below 4G belong to a TASO application.
+   Unfortunately, there is no proper bit in the exec header to check.
+   Worse, we have to notice the start address before swapping to use
+   /sbin/loader, which of course is _not_ a TASO application.  */
+#define SET_AOUT_PERSONALITY(BFPM, EX) \
+       set_personality (((BFPM->sh_bang || EX.ah.entry < 0x100000000L \
+                          ? ADDR_LIMIT_32BIT : 0) | PER_OSF4))
+
+#endif /* __KERNEL__ */
+#endif /* __A_OUT_GNU_H__ */
diff --git a/arch/alpha/include/asm/agp.h b/arch/alpha/include/asm/agp.h
new file mode 100644 (file)
index 0000000..26c1791
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef AGP_H
+#define AGP_H 1
+
+#include <asm/io.h>
+
+/* dummy for now */
+
+#define map_page_into_agp(page) 
+#define unmap_page_from_agp(page) 
+#define flush_agp_cache() mb()
+
+/* Convert a physical address to an address suitable for the GART. */
+#define phys_to_gart(x) (x)
+#define gart_to_phys(x) (x)
+
+/* GATT allocation. Returns/accepts GATT kernel virtual address. */
+#define alloc_gatt_pages(order)                \
+       ((char *)__get_free_pages(GFP_KERNEL, (order)))
+#define free_gatt_pages(table, order)  \
+       free_pages((unsigned long)(table), (order))
+
+#endif
diff --git a/arch/alpha/include/asm/agp_backend.h b/arch/alpha/include/asm/agp_backend.h
new file mode 100644 (file)
index 0000000..55dd44a
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef _ALPHA_AGP_BACKEND_H
+#define _ALPHA_AGP_BACKEND_H 1
+
+typedef        union _alpha_agp_mode {
+       struct {
+               u32 rate : 3;
+               u32 reserved0 : 1;
+               u32 fw : 1;
+               u32 fourgb : 1;
+               u32 reserved1 : 2;
+               u32 enable : 1;
+               u32 sba : 1;
+               u32 reserved2 : 14;
+               u32 rq : 8;
+       } bits;
+       u32 lw;
+} alpha_agp_mode;
+
+typedef struct _alpha_agp_info {
+       struct pci_controller *hose;
+       struct {
+               dma_addr_t bus_base;
+               unsigned long size;
+               void *sysdata;
+       } aperture;
+       alpha_agp_mode capability;
+       alpha_agp_mode mode;
+       void *private;
+       struct alpha_agp_ops *ops;
+} alpha_agp_info;
+
+struct alpha_agp_ops {
+       int (*setup)(alpha_agp_info *);
+       void (*cleanup)(alpha_agp_info *);
+       int (*configure)(alpha_agp_info *);
+       int (*bind)(alpha_agp_info *, off_t, struct agp_memory *);
+       int (*unbind)(alpha_agp_info *, off_t, struct agp_memory *);
+       unsigned long (*translate)(alpha_agp_info *, dma_addr_t);
+};
+
+
+#endif /* _ALPHA_AGP_BACKEND_H */
diff --git a/arch/alpha/include/asm/atomic.h b/arch/alpha/include/asm/atomic.h
new file mode 100644 (file)
index 0000000..ca88e54
--- /dev/null
@@ -0,0 +1,267 @@
+#ifndef _ALPHA_ATOMIC_H
+#define _ALPHA_ATOMIC_H
+
+#include <asm/barrier.h>
+#include <asm/system.h>
+
+/*
+ * Atomic operations that C can't guarantee us.  Useful for
+ * resource counting etc...
+ *
+ * But use these as seldom as possible since they are much slower
+ * than regular operations.
+ */
+
+
+/*
+ * Counter is volatile to make sure gcc doesn't try to be clever
+ * and move things around on us. We need to use _exactly_ the address
+ * the user gave us, not some alias that contains the same information.
+ */
+typedef struct { volatile int counter; } atomic_t;
+typedef struct { volatile long counter; } atomic64_t;
+
+#define ATOMIC_INIT(i)         ( (atomic_t) { (i) } )
+#define ATOMIC64_INIT(i)       ( (atomic64_t) { (i) } )
+
+#define atomic_read(v)         ((v)->counter + 0)
+#define atomic64_read(v)       ((v)->counter + 0)
+
+#define atomic_set(v,i)                ((v)->counter = (i))
+#define atomic64_set(v,i)      ((v)->counter = (i))
+
+/*
+ * To get proper branch prediction for the main line, we must branch
+ * forward to code at the end of this object's .text section, then
+ * branch back to restart the operation.
+ */
+
+static __inline__ void atomic_add(int i, atomic_t * v)
+{
+       unsigned long temp;
+       __asm__ __volatile__(
+       "1:     ldl_l %0,%1\n"
+       "       addl %0,%2,%0\n"
+       "       stl_c %0,%1\n"
+       "       beq %0,2f\n"
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (v->counter)
+       :"Ir" (i), "m" (v->counter));
+}
+
+static __inline__ void atomic64_add(long i, atomic64_t * v)
+{
+       unsigned long temp;
+       __asm__ __volatile__(
+       "1:     ldq_l %0,%1\n"
+       "       addq %0,%2,%0\n"
+       "       stq_c %0,%1\n"
+       "       beq %0,2f\n"
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (v->counter)
+       :"Ir" (i), "m" (v->counter));
+}
+
+static __inline__ void atomic_sub(int i, atomic_t * v)
+{
+       unsigned long temp;
+       __asm__ __volatile__(
+       "1:     ldl_l %0,%1\n"
+       "       subl %0,%2,%0\n"
+       "       stl_c %0,%1\n"
+       "       beq %0,2f\n"
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (v->counter)
+       :"Ir" (i), "m" (v->counter));
+}
+
+static __inline__ void atomic64_sub(long i, atomic64_t * v)
+{
+       unsigned long temp;
+       __asm__ __volatile__(
+       "1:     ldq_l %0,%1\n"
+       "       subq %0,%2,%0\n"
+       "       stq_c %0,%1\n"
+       "       beq %0,2f\n"
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (v->counter)
+       :"Ir" (i), "m" (v->counter));
+}
+
+
+/*
+ * Same as above, but return the result value
+ */
+static inline int atomic_add_return(int i, atomic_t *v)
+{
+       long temp, result;
+       smp_mb();
+       __asm__ __volatile__(
+       "1:     ldl_l %0,%1\n"
+       "       addl %0,%3,%2\n"
+       "       addl %0,%3,%0\n"
+       "       stl_c %0,%1\n"
+       "       beq %0,2f\n"
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (v->counter), "=&r" (result)
+       :"Ir" (i), "m" (v->counter) : "memory");
+       smp_mb();
+       return result;
+}
+
+static __inline__ long atomic64_add_return(long i, atomic64_t * v)
+{
+       long temp, result;
+       smp_mb();
+       __asm__ __volatile__(
+       "1:     ldq_l %0,%1\n"
+       "       addq %0,%3,%2\n"
+       "       addq %0,%3,%0\n"
+       "       stq_c %0,%1\n"
+       "       beq %0,2f\n"
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (v->counter), "=&r" (result)
+       :"Ir" (i), "m" (v->counter) : "memory");
+       smp_mb();
+       return result;
+}
+
+static __inline__ long atomic_sub_return(int i, atomic_t * v)
+{
+       long temp, result;
+       smp_mb();
+       __asm__ __volatile__(
+       "1:     ldl_l %0,%1\n"
+       "       subl %0,%3,%2\n"
+       "       subl %0,%3,%0\n"
+       "       stl_c %0,%1\n"
+       "       beq %0,2f\n"
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (v->counter), "=&r" (result)
+       :"Ir" (i), "m" (v->counter) : "memory");
+       smp_mb();
+       return result;
+}
+
+static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
+{
+       long temp, result;
+       smp_mb();
+       __asm__ __volatile__(
+       "1:     ldq_l %0,%1\n"
+       "       subq %0,%3,%2\n"
+       "       subq %0,%3,%0\n"
+       "       stq_c %0,%1\n"
+       "       beq %0,2f\n"
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (v->counter), "=&r" (result)
+       :"Ir" (i), "m" (v->counter) : "memory");
+       smp_mb();
+       return result;
+}
+
+#define atomic64_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
+#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
+
+#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
+#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
+
+/**
+ * atomic_add_unless - add unless the number is a given value
+ * @v: pointer of type atomic_t
+ * @a: the amount to add to v...
+ * @u: ...unless v is equal to u.
+ *
+ * Atomically adds @a to @v, so long as it was not @u.
+ * Returns non-zero if @v was not @u, and zero otherwise.
+ */
+static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
+{
+       int c, old;
+       c = atomic_read(v);
+       for (;;) {
+               if (unlikely(c == (u)))
+                       break;
+               old = atomic_cmpxchg((v), c, c + (a));
+               if (likely(old == c))
+                       break;
+               c = old;
+       }
+       return c != (u);
+}
+
+#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
+
+/**
+ * atomic64_add_unless - add unless the number is a given value
+ * @v: pointer of type atomic64_t
+ * @a: the amount to add to v...
+ * @u: ...unless v is equal to u.
+ *
+ * Atomically adds @a to @v, so long as it was not @u.
+ * Returns non-zero if @v was not @u, and zero otherwise.
+ */
+static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
+{
+       long c, old;
+       c = atomic64_read(v);
+       for (;;) {
+               if (unlikely(c == (u)))
+                       break;
+               old = atomic64_cmpxchg((v), c, c + (a));
+               if (likely(old == c))
+                       break;
+               c = old;
+       }
+       return c != (u);
+}
+
+#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
+
+#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
+#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0)
+
+#define atomic_dec_return(v) atomic_sub_return(1,(v))
+#define atomic64_dec_return(v) atomic64_sub_return(1,(v))
+
+#define atomic_inc_return(v) atomic_add_return(1,(v))
+#define atomic64_inc_return(v) atomic64_add_return(1,(v))
+
+#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
+#define atomic64_sub_and_test(i,v) (atomic64_sub_return((i), (v)) == 0)
+
+#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0)
+#define atomic64_inc_and_test(v) (atomic64_add_return(1, (v)) == 0)
+
+#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
+#define atomic64_dec_and_test(v) (atomic64_sub_return(1, (v)) == 0)
+
+#define atomic_inc(v) atomic_add(1,(v))
+#define atomic64_inc(v) atomic64_add(1,(v))
+
+#define atomic_dec(v) atomic_sub(1,(v))
+#define atomic64_dec(v) atomic64_sub(1,(v))
+
+#define smp_mb__before_atomic_dec()    smp_mb()
+#define smp_mb__after_atomic_dec()     smp_mb()
+#define smp_mb__before_atomic_inc()    smp_mb()
+#define smp_mb__after_atomic_inc()     smp_mb()
+
+#include <asm-generic/atomic.h>
+#endif /* _ALPHA_ATOMIC_H */
diff --git a/arch/alpha/include/asm/auxvec.h b/arch/alpha/include/asm/auxvec.h
new file mode 100644 (file)
index 0000000..e96fe88
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef __ASM_ALPHA_AUXVEC_H
+#define __ASM_ALPHA_AUXVEC_H
+
+/* Reserve these numbers for any future use of a VDSO.  */
+#if 0
+#define AT_SYSINFO             32
+#define AT_SYSINFO_EHDR                33
+#endif
+
+/* More complete cache descriptions than AT_[DIU]CACHEBSIZE.  If the
+   value is -1, then the cache doesn't exist.  Otherwise:
+
+      bit 0-3:   Cache set-associativity; 0 means fully associative.
+      bit 4-7:   Log2 of cacheline size.
+      bit 8-31:          Size of the entire cache >> 8.
+      bit 32-63:  Reserved.
+*/
+
+#define AT_L1I_CACHESHAPE      34
+#define AT_L1D_CACHESHAPE      35
+#define AT_L2_CACHESHAPE       36
+#define AT_L3_CACHESHAPE       37
+
+#endif /* __ASM_ALPHA_AUXVEC_H */
diff --git a/arch/alpha/include/asm/barrier.h b/arch/alpha/include/asm/barrier.h
new file mode 100644 (file)
index 0000000..ac78eba
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef __BARRIER_H
+#define __BARRIER_H
+
+#include <asm/compiler.h>
+
+#define mb() \
+__asm__ __volatile__("mb": : :"memory")
+
+#define rmb() \
+__asm__ __volatile__("mb": : :"memory")
+
+#define wmb() \
+__asm__ __volatile__("wmb": : :"memory")
+
+#define read_barrier_depends() \
+__asm__ __volatile__("mb": : :"memory")
+
+#ifdef CONFIG_SMP
+#define smp_mb()       mb()
+#define smp_rmb()      rmb()
+#define smp_wmb()      wmb()
+#define smp_read_barrier_depends()     read_barrier_depends()
+#else
+#define smp_mb()       barrier()
+#define smp_rmb()      barrier()
+#define smp_wmb()      barrier()
+#define smp_read_barrier_depends()     do { } while (0)
+#endif
+
+#define set_mb(var, value) \
+do { var = value; mb(); } while (0)
+
+#endif         /* __BARRIER_H */
diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h
new file mode 100644 (file)
index 0000000..15f3ae2
--- /dev/null
@@ -0,0 +1,466 @@
+#ifndef _ALPHA_BITOPS_H
+#define _ALPHA_BITOPS_H
+
+#ifndef _LINUX_BITOPS_H
+#error only <linux/bitops.h> can be included directly
+#endif
+
+#include <asm/compiler.h>
+#include <asm/barrier.h>
+
+/*
+ * Copyright 1994, Linus Torvalds.
+ */
+
+/*
+ * These have to be done with inline assembly: that way the bit-setting
+ * is guaranteed to be atomic. All bit operations return 0 if the bit
+ * was cleared before the operation and != 0 if it was not.
+ *
+ * To get proper branch prediction for the main line, we must branch
+ * forward to code at the end of this object's .text section, then
+ * branch back to restart the operation.
+ *
+ * bit 0 is the LSB of addr; bit 64 is the LSB of (addr+1).
+ */
+
+static inline void
+set_bit(unsigned long nr, volatile void * addr)
+{
+       unsigned long temp;
+       int *m = ((int *) addr) + (nr >> 5);
+
+       __asm__ __volatile__(
+       "1:     ldl_l %0,%3\n"
+       "       bis %0,%2,%0\n"
+       "       stl_c %0,%1\n"
+       "       beq %0,2f\n"
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (*m)
+       :"Ir" (1UL << (nr & 31)), "m" (*m));
+}
+
+/*
+ * WARNING: non atomic version.
+ */
+static inline void
+__set_bit(unsigned long nr, volatile void * addr)
+{
+       int *m = ((int *) addr) + (nr >> 5);
+
+       *m |= 1 << (nr & 31);
+}
+
+#define smp_mb__before_clear_bit()     smp_mb()
+#define smp_mb__after_clear_bit()      smp_mb()
+
+static inline void
+clear_bit(unsigned long nr, volatile void * addr)
+{
+       unsigned long temp;
+       int *m = ((int *) addr) + (nr >> 5);
+
+       __asm__ __volatile__(
+       "1:     ldl_l %0,%3\n"
+       "       bic %0,%2,%0\n"
+       "       stl_c %0,%1\n"
+       "       beq %0,2f\n"
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (*m)
+       :"Ir" (1UL << (nr & 31)), "m" (*m));
+}
+
+static inline void
+clear_bit_unlock(unsigned long nr, volatile void * addr)
+{
+       smp_mb();
+       clear_bit(nr, addr);
+}
+
+/*
+ * WARNING: non atomic version.
+ */
+static __inline__ void
+__clear_bit(unsigned long nr, volatile void * addr)
+{
+       int *m = ((int *) addr) + (nr >> 5);
+
+       *m &= ~(1 << (nr & 31));
+}
+
+static inline void
+__clear_bit_unlock(unsigned long nr, volatile void * addr)
+{
+       smp_mb();
+       __clear_bit(nr, addr);
+}
+
+static inline void
+change_bit(unsigned long nr, volatile void * addr)
+{
+       unsigned long temp;
+       int *m = ((int *) addr) + (nr >> 5);
+
+       __asm__ __volatile__(
+       "1:     ldl_l %0,%3\n"
+       "       xor %0,%2,%0\n"
+       "       stl_c %0,%1\n"
+       "       beq %0,2f\n"
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (*m)
+       :"Ir" (1UL << (nr & 31)), "m" (*m));
+}
+
+/*
+ * WARNING: non atomic version.
+ */
+static __inline__ void
+__change_bit(unsigned long nr, volatile void * addr)
+{
+       int *m = ((int *) addr) + (nr >> 5);
+
+       *m ^= 1 << (nr & 31);
+}
+
+static inline int
+test_and_set_bit(unsigned long nr, volatile void *addr)
+{
+       unsigned long oldbit;
+       unsigned long temp;
+       int *m = ((int *) addr) + (nr >> 5);
+
+       __asm__ __volatile__(
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       "1:     ldl_l %0,%4\n"
+       "       and %0,%3,%2\n"
+       "       bne %2,2f\n"
+       "       xor %0,%3,%0\n"
+       "       stl_c %0,%1\n"
+       "       beq %0,3f\n"
+       "2:\n"
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       ".subsection 2\n"
+       "3:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (*m), "=&r" (oldbit)
+       :"Ir" (1UL << (nr & 31)), "m" (*m) : "memory");
+
+       return oldbit != 0;
+}
+
+static inline int
+test_and_set_bit_lock(unsigned long nr, volatile void *addr)
+{
+       unsigned long oldbit;
+       unsigned long temp;
+       int *m = ((int *) addr) + (nr >> 5);
+
+       __asm__ __volatile__(
+       "1:     ldl_l %0,%4\n"
+       "       and %0,%3,%2\n"
+       "       bne %2,2f\n"
+       "       xor %0,%3,%0\n"
+       "       stl_c %0,%1\n"
+       "       beq %0,3f\n"
+       "2:\n"
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       ".subsection 2\n"
+       "3:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (*m), "=&r" (oldbit)
+       :"Ir" (1UL << (nr & 31)), "m" (*m) : "memory");
+
+       return oldbit != 0;
+}
+
+/*
+ * WARNING: non atomic version.
+ */
+static inline int
+__test_and_set_bit(unsigned long nr, volatile void * addr)
+{
+       unsigned long mask = 1 << (nr & 0x1f);
+       int *m = ((int *) addr) + (nr >> 5);
+       int old = *m;
+
+       *m = old | mask;
+       return (old & mask) != 0;
+}
+
+static inline int
+test_and_clear_bit(unsigned long nr, volatile void * addr)
+{
+       unsigned long oldbit;
+       unsigned long temp;
+       int *m = ((int *) addr) + (nr >> 5);
+
+       __asm__ __volatile__(
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       "1:     ldl_l %0,%4\n"
+       "       and %0,%3,%2\n"
+       "       beq %2,2f\n"
+       "       xor %0,%3,%0\n"
+       "       stl_c %0,%1\n"
+       "       beq %0,3f\n"
+       "2:\n"
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       ".subsection 2\n"
+       "3:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (*m), "=&r" (oldbit)
+       :"Ir" (1UL << (nr & 31)), "m" (*m) : "memory");
+
+       return oldbit != 0;
+}
+
+/*
+ * WARNING: non atomic version.
+ */
+static inline int
+__test_and_clear_bit(unsigned long nr, volatile void * addr)
+{
+       unsigned long mask = 1 << (nr & 0x1f);
+       int *m = ((int *) addr) + (nr >> 5);
+       int old = *m;
+
+       *m = old & ~mask;
+       return (old & mask) != 0;
+}
+
+static inline int
+test_and_change_bit(unsigned long nr, volatile void * addr)
+{
+       unsigned long oldbit;
+       unsigned long temp;
+       int *m = ((int *) addr) + (nr >> 5);
+
+       __asm__ __volatile__(
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       "1:     ldl_l %0,%4\n"
+       "       and %0,%3,%2\n"
+       "       xor %0,%3,%0\n"
+       "       stl_c %0,%1\n"
+       "       beq %0,3f\n"
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       ".subsection 2\n"
+       "3:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (*m), "=&r" (oldbit)
+       :"Ir" (1UL << (nr & 31)), "m" (*m) : "memory");
+
+       return oldbit != 0;
+}
+
+/*
+ * WARNING: non atomic version.
+ */
+static __inline__ int
+__test_and_change_bit(unsigned long nr, volatile void * addr)
+{
+       unsigned long mask = 1 << (nr & 0x1f);
+       int *m = ((int *) addr) + (nr >> 5);
+       int old = *m;
+
+       *m = old ^ mask;
+       return (old & mask) != 0;
+}
+
+static inline int
+test_bit(int nr, const volatile void * addr)
+{
+       return (1UL & (((const int *) addr)[nr >> 5] >> (nr & 31))) != 0UL;
+}
+
+/*
+ * ffz = Find First Zero in word. Undefined if no zero exists,
+ * so code should check against ~0UL first..
+ *
+ * Do a binary search on the bits.  Due to the nature of large
+ * constants on the alpha, it is worthwhile to split the search.
+ */
+static inline unsigned long ffz_b(unsigned long x)
+{
+       unsigned long sum, x1, x2, x4;
+
+       x = ~x & -~x;           /* set first 0 bit, clear others */
+       x1 = x & 0xAA;
+       x2 = x & 0xCC;
+       x4 = x & 0xF0;
+       sum = x2 ? 2 : 0;
+       sum += (x4 != 0) * 4;
+       sum += (x1 != 0);
+
+       return sum;
+}
+
+static inline unsigned long ffz(unsigned long word)
+{
+#if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67)
+       /* Whee.  EV67 can calculate it directly.  */
+       return __kernel_cttz(~word);
+#else
+       unsigned long bits, qofs, bofs;
+
+       bits = __kernel_cmpbge(word, ~0UL);
+       qofs = ffz_b(bits);
+       bits = __kernel_extbl(word, qofs);
+       bofs = ffz_b(bits);
+
+       return qofs*8 + bofs;
+#endif
+}
+
+/*
+ * __ffs = Find First set bit in word.  Undefined if no set bit exists.
+ */
+static inline unsigned long __ffs(unsigned long word)
+{
+#if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67)
+       /* Whee.  EV67 can calculate it directly.  */
+       return __kernel_cttz(word);
+#else
+       unsigned long bits, qofs, bofs;
+
+       bits = __kernel_cmpbge(0, word);
+       qofs = ffz_b(bits);
+       bits = __kernel_extbl(word, qofs);
+       bofs = ffz_b(~bits);
+
+       return qofs*8 + bofs;
+#endif
+}
+
+#ifdef __KERNEL__
+
+/*
+ * ffs: find first bit set. This is defined the same way as
+ * the libc and compiler builtin ffs routines, therefore
+ * differs in spirit from the above __ffs.
+ */
+
+static inline int ffs(int word)
+{
+       int result = __ffs(word) + 1;
+       return word ? result : 0;
+}
+
+/*
+ * fls: find last bit set.
+ */
+#if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67)
+static inline int fls64(unsigned long word)
+{
+       return 64 - __kernel_ctlz(word);
+}
+#else
+extern const unsigned char __flsm1_tab[256];
+
+static inline int fls64(unsigned long x)
+{
+       unsigned long t, a, r;
+
+       t = __kernel_cmpbge (x, 0x0101010101010101UL);
+       a = __flsm1_tab[t];
+       t = __kernel_extbl (x, a);
+       r = a*8 + __flsm1_tab[t] + (x != 0);
+
+       return r;
+}
+#endif
+
+static inline unsigned long __fls(unsigned long x)
+{
+       return fls64(x) - 1;
+}
+
+static inline int fls(int x)
+{
+       return fls64((unsigned int) x);
+}
+
+/*
+ * hweightN: returns the hamming weight (i.e. the number
+ * of bits set) of a N-bit word
+ */
+
+#if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67)
+/* Whee.  EV67 can calculate it directly.  */
+static inline unsigned long hweight64(unsigned long w)
+{
+       return __kernel_ctpop(w);
+}
+
+static inline unsigned int hweight32(unsigned int w)
+{
+       return hweight64(w);
+}
+
+static inline unsigned int hweight16(unsigned int w)
+{
+       return hweight64(w & 0xffff);
+}
+
+static inline unsigned int hweight8(unsigned int w)
+{
+       return hweight64(w & 0xff);
+}
+#else
+#include <asm-generic/bitops/hweight.h>
+#endif
+
+#endif /* __KERNEL__ */
+
+#include <asm-generic/bitops/find.h>
+
+#ifdef __KERNEL__
+
+/*
+ * Every architecture must define this function. It's the fastest
+ * way of searching a 140-bit bitmap where the first 100 bits are
+ * unlikely to be set. It's guaranteed that at least one of the 140
+ * bits is set.
+ */
+static inline unsigned long
+sched_find_first_bit(unsigned long b[3])
+{
+       unsigned long b0 = b[0], b1 = b[1], b2 = b[2];
+       unsigned long ofs;
+
+       ofs = (b1 ? 64 : 128);
+       b1 = (b1 ? b1 : b2);
+       ofs = (b0 ? 0 : ofs);
+       b0 = (b0 ? b0 : b1);
+
+       return __ffs(b0) + ofs;
+}
+
+#include <asm-generic/bitops/ext2-non-atomic.h>
+
+#define ext2_set_bit_atomic(l,n,a)   test_and_set_bit(n,a)
+#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
+
+#include <asm-generic/bitops/minix.h>
+
+#endif /* __KERNEL__ */
+
+#endif /* _ALPHA_BITOPS_H */
diff --git a/arch/alpha/include/asm/bug.h b/arch/alpha/include/asm/bug.h
new file mode 100644 (file)
index 0000000..695a5ee
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef _ALPHA_BUG_H
+#define _ALPHA_BUG_H
+
+#include <linux/linkage.h>
+
+#ifdef CONFIG_BUG
+#include <asm/pal.h>
+
+/* ??? Would be nice to use .gprel32 here, but we can't be sure that the
+   function loaded the GP, so this could fail in modules.  */
+static inline void ATTRIB_NORET __BUG(const char *file, int line)
+{
+       __asm__ __volatile__(
+               "call_pal %0  # bugchk\n\t"
+               ".long %1\n\t.8byte %2"
+                      : : "i" (PAL_bugchk), "i"(line), "i"(file));
+       for ( ; ; )
+               ;
+}
+
+#define BUG() __BUG(__FILE__, __LINE__)
+
+#define HAVE_ARCH_BUG
+#endif
+
+#include <asm-generic/bug.h>
+
+#endif
diff --git a/arch/alpha/include/asm/bugs.h b/arch/alpha/include/asm/bugs.h
new file mode 100644 (file)
index 0000000..78030d1
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ *  include/asm-alpha/bugs.h
+ *
+ *  Copyright (C) 1994  Linus Torvalds
+ */
+
+/*
+ * This is included by init/main.c to check for architecture-dependent bugs.
+ *
+ * Needs:
+ *     void check_bugs(void);
+ */
+
+/*
+ * I don't know of any alpha bugs yet.. Nice chip
+ */
+
+static void check_bugs(void)
+{
+}
diff --git a/arch/alpha/include/asm/byteorder.h b/arch/alpha/include/asm/byteorder.h
new file mode 100644 (file)
index 0000000..58e958f
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef _ALPHA_BYTEORDER_H
+#define _ALPHA_BYTEORDER_H
+
+#include <asm/types.h>
+#include <linux/compiler.h>
+#include <asm/compiler.h>
+
+#ifdef __GNUC__
+
+static inline __attribute_const__ __u32 __arch__swab32(__u32 x)
+{
+       /*
+        * Unfortunately, we can't use the 6 instruction sequence
+        * on ev6 since the latency of the UNPKBW is 3, which is
+        * pretty hard to hide.  Just in case a future implementation
+        * has a lower latency, here's the sequence (also by Mike Burrows)
+        *
+        * UNPKBW a0, v0       v0: 00AA00BB00CC00DD
+        * SLL v0, 24, a0      a0: BB00CC00DD000000
+        * BIS v0, a0, a0      a0: BBAACCBBDDCC00DD
+        * EXTWL a0, 6, v0     v0: 000000000000BBAA
+        * ZAP a0, 0xf3, a0    a0: 00000000DDCC0000
+        * ADDL a0, v0, v0     v0: ssssssssDDCCBBAA
+        */
+
+       __u64 t0, t1, t2, t3;
+
+       t0 = __kernel_inslh(x, 7);      /* t0 : 0000000000AABBCC */
+       t1 = __kernel_inswl(x, 3);      /* t1 : 000000CCDD000000 */
+       t1 |= t0;                       /* t1 : 000000CCDDAABBCC */
+       t2 = t1 >> 16;                  /* t2 : 0000000000CCDDAA */
+       t0 = t1 & 0xFF00FF00;           /* t0 : 00000000DD00BB00 */
+       t3 = t2 & 0x00FF00FF;           /* t3 : 0000000000CC00AA */
+       t1 = t0 + t3;                   /* t1 : ssssssssDDCCBBAA */
+
+       return t1;
+}
+
+#define __arch__swab32 __arch__swab32
+
+#endif /* __GNUC__ */
+
+#define __BYTEORDER_HAS_U64__
+
+#include <linux/byteorder/little_endian.h>
+
+#endif /* _ALPHA_BYTEORDER_H */
diff --git a/arch/alpha/include/asm/cache.h b/arch/alpha/include/asm/cache.h
new file mode 100644 (file)
index 0000000..f199e69
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * include/asm-alpha/cache.h
+ */
+#ifndef __ARCH_ALPHA_CACHE_H
+#define __ARCH_ALPHA_CACHE_H
+
+
+/* Bytes per L1 (data) cache line. */
+#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_EV6)
+# define L1_CACHE_BYTES     64
+# define L1_CACHE_SHIFT     6
+#else
+/* Both EV4 and EV5 are write-through, read-allocate,
+   direct-mapped, physical.
+*/
+# define L1_CACHE_BYTES     32
+# define L1_CACHE_SHIFT     5
+#endif
+
+#define L1_CACHE_ALIGN(x)  (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
+#define SMP_CACHE_BYTES    L1_CACHE_BYTES
+
+#endif
diff --git a/arch/alpha/include/asm/cacheflush.h b/arch/alpha/include/asm/cacheflush.h
new file mode 100644 (file)
index 0000000..b686cc7
--- /dev/null
@@ -0,0 +1,74 @@
+#ifndef _ALPHA_CACHEFLUSH_H
+#define _ALPHA_CACHEFLUSH_H
+
+#include <linux/mm.h>
+
+/* Caches aren't brain-dead on the Alpha. */
+#define flush_cache_all()                      do { } while (0)
+#define flush_cache_mm(mm)                     do { } while (0)
+#define flush_cache_dup_mm(mm)                 do { } while (0)
+#define flush_cache_range(vma, start, end)     do { } while (0)
+#define flush_cache_page(vma, vmaddr, pfn)     do { } while (0)
+#define flush_dcache_page(page)                        do { } while (0)
+#define flush_dcache_mmap_lock(mapping)                do { } while (0)
+#define flush_dcache_mmap_unlock(mapping)      do { } while (0)
+#define flush_cache_vmap(start, end)           do { } while (0)
+#define flush_cache_vunmap(start, end)         do { } while (0)
+
+/* Note that the following two definitions are _highly_ dependent
+   on the contexts in which they are used in the kernel.  I personally
+   think it is criminal how loosely defined these macros are.  */
+
+/* We need to flush the kernel's icache after loading modules.  The
+   only other use of this macro is in load_aout_interp which is not
+   used on Alpha. 
+
+   Note that this definition should *not* be used for userspace
+   icache flushing.  While functional, it is _way_ overkill.  The
+   icache is tagged with ASNs and it suffices to allocate a new ASN
+   for the process.  */
+#ifndef CONFIG_SMP
+#define flush_icache_range(start, end)         imb()
+#else
+#define flush_icache_range(start, end)         smp_imb()
+extern void smp_imb(void);
+#endif
+
+/* We need to flush the userspace icache after setting breakpoints in
+   ptrace.
+
+   Instead of indiscriminately using imb, take advantage of the fact
+   that icache entries are tagged with the ASN and load a new mm context.  */
+/* ??? Ought to use this in arch/alpha/kernel/signal.c too.  */
+
+#ifndef CONFIG_SMP
+extern void __load_new_mm_context(struct mm_struct *);
+static inline void
+flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
+                       unsigned long addr, int len)
+{
+       if (vma->vm_flags & VM_EXEC) {
+               struct mm_struct *mm = vma->vm_mm;
+               if (current->active_mm == mm)
+                       __load_new_mm_context(mm);
+               else
+                       mm->context[smp_processor_id()] = 0;
+       }
+}
+#else
+extern void flush_icache_user_range(struct vm_area_struct *vma,
+               struct page *page, unsigned long addr, int len);
+#endif
+
+/* This is used only in do_no_page and do_swap_page.  */
+#define flush_icache_page(vma, page) \
+  flush_icache_user_range((vma), (page), 0, 0)
+
+#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
+do { memcpy(dst, src, len); \
+     flush_icache_user_range(vma, page, vaddr, len); \
+} while (0)
+#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
+       memcpy(dst, src, len)
+
+#endif /* _ALPHA_CACHEFLUSH_H */
diff --git a/arch/alpha/include/asm/checksum.h b/arch/alpha/include/asm/checksum.h
new file mode 100644 (file)
index 0000000..d3854bb
--- /dev/null
@@ -0,0 +1,75 @@
+#ifndef _ALPHA_CHECKSUM_H
+#define _ALPHA_CHECKSUM_H
+
+#include <linux/in6.h>
+
+/*
+ *     This is a version of ip_compute_csum() optimized for IP headers,
+ *     which always checksum on 4 octet boundaries.
+ */
+extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
+
+/*
+ * computes the checksum of the TCP/UDP pseudo-header
+ * returns a 16-bit checksum, already complemented
+ */
+extern __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
+                                          unsigned short len,
+                                          unsigned short proto,
+                                          __wsum sum);
+
+__wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
+                               unsigned short len, unsigned short proto,
+                               __wsum sum);
+
+/*
+ * computes the checksum of a memory block at buff, length len,
+ * and adds in "sum" (32-bit)
+ *
+ * returns a 32-bit number suitable for feeding into itself
+ * or csum_tcpudp_magic
+ *
+ * this function must be called with even lengths, except
+ * for the last fragment, which may be odd
+ *
+ * it's best to have buff aligned on a 32-bit boundary
+ */
+extern __wsum csum_partial(const void *buff, int len, __wsum sum);
+
+/*
+ * the same as csum_partial, but copies from src while it
+ * checksums
+ *
+ * here even more important to align src and dst on a 32-bit (or even
+ * better 64-bit) boundary
+ */
+__wsum csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *errp);
+
+__wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
+
+
+/*
+ * this routine is used for miscellaneous IP-like checksums, mainly
+ * in icmp.c
+ */
+
+extern __sum16 ip_compute_csum(const void *buff, int len);
+
+/*
+ *     Fold a partial checksum without adding pseudo headers
+ */
+
+static inline __sum16 csum_fold(__wsum csum)
+{
+       u32 sum = (__force u32)csum;
+       sum = (sum & 0xffff) + (sum >> 16);
+       sum = (sum & 0xffff) + (sum >> 16);
+       return (__force __sum16)~sum;
+}
+
+#define _HAVE_ARCH_IPV6_CSUM
+extern __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
+                              const struct in6_addr *daddr,
+                              __u32 len, unsigned short proto,
+                              __wsum sum);
+#endif
diff --git a/arch/alpha/include/asm/compiler.h b/arch/alpha/include/asm/compiler.h
new file mode 100644 (file)
index 0000000..da6bb19
--- /dev/null
@@ -0,0 +1,130 @@
+#ifndef __ALPHA_COMPILER_H
+#define __ALPHA_COMPILER_H
+
+/* 
+ * Herein are macros we use when describing various patterns we want to GCC.
+ * In all cases we can get better schedules out of the compiler if we hide
+ * as little as possible inside inline assembly.  However, we want to be
+ * able to know what we'll get out before giving up inline assembly.  Thus
+ * these tests and macros.
+ */
+
+#if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3
+# define __kernel_insbl(val, shift)    __builtin_alpha_insbl(val, shift)
+# define __kernel_inswl(val, shift)    __builtin_alpha_inswl(val, shift)
+# define __kernel_insql(val, shift)    __builtin_alpha_insql(val, shift)
+# define __kernel_inslh(val, shift)    __builtin_alpha_inslh(val, shift)
+# define __kernel_extbl(val, shift)    __builtin_alpha_extbl(val, shift)
+# define __kernel_extwl(val, shift)    __builtin_alpha_extwl(val, shift)
+# define __kernel_cmpbge(a, b)         __builtin_alpha_cmpbge(a, b)
+#else
+# define __kernel_insbl(val, shift)                                    \
+  ({ unsigned long __kir;                                              \
+     __asm__("insbl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));  \
+     __kir; })
+# define __kernel_inswl(val, shift)                                    \
+  ({ unsigned long __kir;                                              \
+     __asm__("inswl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));  \
+     __kir; })
+# define __kernel_insql(val, shift)                                    \
+  ({ unsigned long __kir;                                              \
+     __asm__("insql %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));  \
+     __kir; })
+# define __kernel_inslh(val, shift)                                    \
+  ({ unsigned long __kir;                                              \
+     __asm__("inslh %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));  \
+     __kir; })
+# define __kernel_extbl(val, shift)                                    \
+  ({ unsigned long __kir;                                              \
+     __asm__("extbl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));  \
+     __kir; })
+# define __kernel_extwl(val, shift)                                    \
+  ({ unsigned long __kir;                                              \
+     __asm__("extwl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));  \
+     __kir; })
+# define __kernel_cmpbge(a, b)                                         \
+  ({ unsigned long __kir;                                              \
+     __asm__("cmpbge %r2,%1,%0" : "=r"(__kir) : "rI"(b), "rJ"(a));     \
+     __kir; })
+#endif
+
+#ifdef __alpha_cix__
+# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3
+#  define __kernel_cttz(x)             __builtin_ctzl(x)
+#  define __kernel_ctlz(x)             __builtin_clzl(x)
+#  define __kernel_ctpop(x)            __builtin_popcountl(x)
+# else
+#  define __kernel_cttz(x)                                             \
+   ({ unsigned long __kir;                                             \
+      __asm__("cttz %1,%0" : "=r"(__kir) : "r"(x));                    \
+      __kir; })
+#  define __kernel_ctlz(x)                                             \
+   ({ unsigned long __kir;                                             \
+      __asm__("ctlz %1,%0" : "=r"(__kir) : "r"(x));                    \
+      __kir; })
+#  define __kernel_ctpop(x)                                            \
+   ({ unsigned long __kir;                                             \
+      __asm__("ctpop %1,%0" : "=r"(__kir) : "r"(x));                   \
+      __kir; })
+# endif
+#else
+# define __kernel_cttz(x)                                              \
+  ({ unsigned long __kir;                                              \
+     __asm__(".arch ev67; cttz %1,%0" : "=r"(__kir) : "r"(x));         \
+     __kir; })
+# define __kernel_ctlz(x)                                              \
+  ({ unsigned long __kir;                                              \
+     __asm__(".arch ev67; ctlz %1,%0" : "=r"(__kir) : "r"(x));         \
+     __kir; })
+# define __kernel_ctpop(x)                                             \
+  ({ unsigned long __kir;                                              \
+     __asm__(".arch ev67; ctpop %1,%0" : "=r"(__kir) : "r"(x));                \
+     __kir; })
+#endif
+
+
+/* 
+ * Beginning with EGCS 1.1, GCC defines __alpha_bwx__ when the BWX 
+ * extension is enabled.  Previous versions did not define anything
+ * we could test during compilation -- too bad, so sad.
+ */
+
+#if defined(__alpha_bwx__)
+#define __kernel_ldbu(mem)     (mem)
+#define __kernel_ldwu(mem)     (mem)
+#define __kernel_stb(val,mem)  ((mem) = (val))
+#define __kernel_stw(val,mem)  ((mem) = (val))
+#else
+#define __kernel_ldbu(mem)                             \
+  ({ unsigned char __kir;                              \
+     __asm__(".arch ev56;                              \
+             ldbu %0,%1" : "=r"(__kir) : "m"(mem));    \
+     __kir; })
+#define __kernel_ldwu(mem)                             \
+  ({ unsigned short __kir;                             \
+     __asm__(".arch ev56;                              \
+             ldwu %0,%1" : "=r"(__kir) : "m"(mem));    \
+     __kir; })
+#define __kernel_stb(val,mem)                          \
+  __asm__(".arch ev56;                                 \
+          stb %1,%0" : "=m"(mem) : "r"(val))
+#define __kernel_stw(val,mem)                          \
+  __asm__(".arch ev56;                                 \
+          stw %1,%0" : "=m"(mem) : "r"(val))
+#endif
+
+#ifdef __KERNEL__
+/* Some idiots over in <linux/compiler.h> thought inline should imply
+   always_inline.  This breaks stuff.  We'll include this file whenever
+   we run into such problems.  */
+
+#include <linux/compiler.h>
+#undef inline
+#undef __inline__
+#undef __inline
+#undef __always_inline
+#define __always_inline                inline __attribute__((always_inline))
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_COMPILER_H */
diff --git a/arch/alpha/include/asm/console.h b/arch/alpha/include/asm/console.h
new file mode 100644 (file)
index 0000000..a3ce4e6
--- /dev/null
@@ -0,0 +1,75 @@
+#ifndef __AXP_CONSOLE_H
+#define __AXP_CONSOLE_H
+
+/*
+ * Console callback routine numbers
+ */
+#define CCB_GETC               0x01
+#define CCB_PUTS               0x02
+#define CCB_RESET_TERM         0x03
+#define CCB_SET_TERM_INT       0x04
+#define CCB_SET_TERM_CTL       0x05
+#define CCB_PROCESS_KEYCODE    0x06
+#define CCB_OPEN_CONSOLE       0x07
+#define CCB_CLOSE_CONSOLE      0x08
+
+#define CCB_OPEN               0x10
+#define CCB_CLOSE              0x11
+#define CCB_IOCTL              0x12
+#define CCB_READ               0x13
+#define CCB_WRITE              0x14
+
+#define CCB_SET_ENV            0x20
+#define CCB_RESET_ENV          0x21
+#define CCB_GET_ENV            0x22
+#define CCB_SAVE_ENV           0x23
+
+#define CCB_PSWITCH            0x30
+#define CCB_BIOS_EMUL          0x32
+
+/*
+ * Environment variable numbers
+ */
+#define ENV_AUTO_ACTION                0x01
+#define ENV_BOOT_DEV           0x02
+#define ENV_BOOTDEF_DEV                0x03
+#define ENV_BOOTED_DEV         0x04
+#define ENV_BOOT_FILE          0x05
+#define ENV_BOOTED_FILE                0x06
+#define ENV_BOOT_OSFLAGS       0x07
+#define ENV_BOOTED_OSFLAGS     0x08
+#define ENV_BOOT_RESET         0x09
+#define ENV_DUMP_DEV           0x0A
+#define ENV_ENABLE_AUDIT       0x0B
+#define ENV_LICENSE            0x0C
+#define ENV_CHAR_SET           0x0D
+#define ENV_LANGUAGE           0x0E
+#define ENV_TTY_DEV            0x0F
+
+#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
+extern long callback_puts(long unit, const char *s, long length);
+extern long callback_getc(long unit);
+extern long callback_open_console(void);
+extern long callback_close_console(void);
+extern long callback_open(const char *device, long length);
+extern long callback_close(long unit);
+extern long callback_read(long channel, long count, const char *buf, long lbn);
+extern long callback_getenv(long id, const char *buf, unsigned long buf_size);
+extern long callback_setenv(long id, const char *buf, unsigned long buf_size);
+extern long callback_save_env(void);
+
+extern int srm_fixup(unsigned long new_callback_addr,
+                    unsigned long new_hwrpb_addr);
+extern long srm_puts(const char *, long);
+extern long srm_printk(const char *, ...)
+       __attribute__ ((format (printf, 1, 2)));
+
+struct crb_struct;
+struct hwrpb_struct;
+extern int callback_init_done;
+extern void * callback_init(void *);
+#endif /* __ASSEMBLY__ */
+#endif /* __KERNEL__ */
+
+#endif /* __AXP_CONSOLE_H */
diff --git a/arch/alpha/include/asm/core_apecs.h b/arch/alpha/include/asm/core_apecs.h
new file mode 100644 (file)
index 0000000..6785ff7
--- /dev/null
@@ -0,0 +1,517 @@
+#ifndef __ALPHA_APECS__H__
+#define __ALPHA_APECS__H__
+
+#include <linux/types.h>
+#include <asm/compiler.h>
+
+/*
+ * APECS is the internal name for the 2107x chipset which provides
+ * memory controller and PCI access for the 21064 chip based systems.
+ *
+ * This file is based on:
+ *
+ * DECchip 21071-AA and DECchip 21072-AA Core Logic Chipsets
+ * Data Sheet
+ *
+ * EC-N0648-72
+ *
+ *
+ * david.rusling@reo.mts.dec.com Initial Version.
+ *
+ */
+
+/*
+   An AVANTI *might* be an XL, and an XL has only 27 bits of ISA address
+   that get passed through the PCI<->ISA bridge chip. So we've gotta use
+   both windows to max out the physical memory we can DMA to. Sigh...
+
+   If we try a window at 0 for 1GB as a work-around, we run into conflicts
+   with ISA/PCI bus memory which can't be relocated, like VGA aperture and
+   BIOS ROMs. So we must put the windows high enough to avoid these areas.
+
+   We put window 1 at BUS 64Mb for 64Mb, mapping physical 0 to 64Mb-1,
+   and window 2 at BUS 1Gb for 1Gb, mapping physical 0 to 1Gb-1.
+   Yes, this does map 0 to 64Mb-1 twice, but only window 1 will actually
+   be used for that range (via virt_to_bus()).
+
+   Note that we actually fudge the window 1 maximum as 48Mb instead of 64Mb,
+   to keep virt_to_bus() from returning an address in the first window, for
+   a data area that goes beyond the 64Mb first DMA window.  Sigh...
+   The fudge factor MUST match with <asm/dma.h> MAX_DMA_ADDRESS, but
+   we can't just use that here, because of header file looping... :-(
+
+   Window 1 will be used for all DMA from the ISA bus; yes, that does
+   limit what memory an ISA floppy or sound card or Ethernet can touch, but
+   it's also a known limitation on other platforms as well. We use the
+   same technique that is used on INTEL platforms with similar limitation:
+   set MAX_DMA_ADDRESS and clear some pages' DMAable flags during mem_init().
+   We trust that any ISA bus device drivers will *always* ask for DMAable
+   memory explicitly via kmalloc()/get_free_pages() flags arguments.
+
+   Note that most PCI bus devices' drivers do *not* explicitly ask for
+   DMAable memory; they count on being able to DMA to any memory they
+   get from kmalloc()/get_free_pages(). They will also use window 1 for
+   any physical memory accesses below 64Mb; the rest will be handled by
+   window 2, maxing out at 1Gb of memory. I trust this is enough... :-)
+
+   We hope that the area before the first window is large enough so that
+   there will be no overlap at the top end (64Mb). We *must* locate the
+   PCI cards' memory just below window 1, so that there's still the
+   possibility of being able to access it via SPARSE space. This is
+   important for cards such as the Matrox Millennium, whose Xserver
+   wants to access memory-mapped registers in byte and short lengths.
+
+   Note that the XL is treated differently from the AVANTI, even though
+   for most other things they are identical. It didn't seem reasonable to
+   make the AVANTI support pay for the limitations of the XL. It is true,
+   however, that an XL kernel will run on an AVANTI without problems.
+
+   %%% All of this should be obviated by the ability to route
+   everything through the iommu.
+*/
+
+/*
+ * 21071-DA Control and Status registers.
+ * These are used for PCI memory access.
+ */
+#define APECS_IOC_DCSR                  (IDENT_ADDR + 0x1A0000000UL)
+#define APECS_IOC_PEAR                  (IDENT_ADDR + 0x1A0000020UL)
+#define APECS_IOC_SEAR                  (IDENT_ADDR + 0x1A0000040UL)
+#define APECS_IOC_DR1                   (IDENT_ADDR + 0x1A0000060UL)
+#define APECS_IOC_DR2                   (IDENT_ADDR + 0x1A0000080UL)
+#define APECS_IOC_DR3                   (IDENT_ADDR + 0x1A00000A0UL)
+
+#define APECS_IOC_TB1R                  (IDENT_ADDR + 0x1A00000C0UL)
+#define APECS_IOC_TB2R                  (IDENT_ADDR + 0x1A00000E0UL)
+
+#define APECS_IOC_PB1R                  (IDENT_ADDR + 0x1A0000100UL)
+#define APECS_IOC_PB2R                  (IDENT_ADDR + 0x1A0000120UL)
+
+#define APECS_IOC_PM1R                  (IDENT_ADDR + 0x1A0000140UL)
+#define APECS_IOC_PM2R                  (IDENT_ADDR + 0x1A0000160UL)
+
+#define APECS_IOC_HAXR0                 (IDENT_ADDR + 0x1A0000180UL)
+#define APECS_IOC_HAXR1                 (IDENT_ADDR + 0x1A00001A0UL)
+#define APECS_IOC_HAXR2                 (IDENT_ADDR + 0x1A00001C0UL)
+
+#define APECS_IOC_PMLT                  (IDENT_ADDR + 0x1A00001E0UL)
+
+#define APECS_IOC_TLBTAG0               (IDENT_ADDR + 0x1A0000200UL)
+#define APECS_IOC_TLBTAG1               (IDENT_ADDR + 0x1A0000220UL)
+#define APECS_IOC_TLBTAG2               (IDENT_ADDR + 0x1A0000240UL)
+#define APECS_IOC_TLBTAG3               (IDENT_ADDR + 0x1A0000260UL)
+#define APECS_IOC_TLBTAG4               (IDENT_ADDR + 0x1A0000280UL)
+#define APECS_IOC_TLBTAG5               (IDENT_ADDR + 0x1A00002A0UL)
+#define APECS_IOC_TLBTAG6               (IDENT_ADDR + 0x1A00002C0UL)
+#define APECS_IOC_TLBTAG7               (IDENT_ADDR + 0x1A00002E0UL)
+
+#define APECS_IOC_TLBDATA0              (IDENT_ADDR + 0x1A0000300UL)
+#define APECS_IOC_TLBDATA1              (IDENT_ADDR + 0x1A0000320UL)
+#define APECS_IOC_TLBDATA2              (IDENT_ADDR + 0x1A0000340UL)
+#define APECS_IOC_TLBDATA3              (IDENT_ADDR + 0x1A0000360UL)
+#define APECS_IOC_TLBDATA4              (IDENT_ADDR + 0x1A0000380UL)
+#define APECS_IOC_TLBDATA5              (IDENT_ADDR + 0x1A00003A0UL)
+#define APECS_IOC_TLBDATA6              (IDENT_ADDR + 0x1A00003C0UL)
+#define APECS_IOC_TLBDATA7              (IDENT_ADDR + 0x1A00003E0UL)
+
+#define APECS_IOC_TBIA                  (IDENT_ADDR + 0x1A0000400UL)
+
+
+/*
+ * 21071-CA Control and Status registers.
+ * These are used to program memory timing,
+ *  configure memory and initialise the B-Cache.
+ */
+#define APECS_MEM_GCR                  (IDENT_ADDR + 0x180000000UL)
+#define APECS_MEM_EDSR                 (IDENT_ADDR + 0x180000040UL)
+#define APECS_MEM_TAR                          (IDENT_ADDR + 0x180000060UL)
+#define APECS_MEM_ELAR                 (IDENT_ADDR + 0x180000080UL)
+#define APECS_MEM_EHAR                 (IDENT_ADDR + 0x1800000a0UL)
+#define APECS_MEM_SFT_RST              (IDENT_ADDR + 0x1800000c0UL)
+#define APECS_MEM_LDxLAR               (IDENT_ADDR + 0x1800000e0UL)
+#define APECS_MEM_LDxHAR               (IDENT_ADDR + 0x180000100UL)
+#define APECS_MEM_GTR                  (IDENT_ADDR + 0x180000200UL)
+#define APECS_MEM_RTR                  (IDENT_ADDR + 0x180000220UL)
+#define APECS_MEM_VFPR                 (IDENT_ADDR + 0x180000240UL)
+#define APECS_MEM_PDLDR                (IDENT_ADDR + 0x180000260UL)
+#define APECS_MEM_PDhDR                (IDENT_ADDR + 0x180000280UL)
+
+/* Bank x Base Address Register */
+#define APECS_MEM_B0BAR                (IDENT_ADDR + 0x180000800UL)
+#define APECS_MEM_B1BAR                (IDENT_ADDR + 0x180000820UL)
+#define APECS_MEM_B2BAR                (IDENT_ADDR + 0x180000840UL)
+#define APECS_MEM_B3BAR                (IDENT_ADDR + 0x180000860UL)
+#define APECS_MEM_B4BAR                (IDENT_ADDR + 0x180000880UL)
+#define APECS_MEM_B5BAR                (IDENT_ADDR + 0x1800008A0UL)
+#define APECS_MEM_B6BAR                (IDENT_ADDR + 0x1800008C0UL)
+#define APECS_MEM_B7BAR                (IDENT_ADDR + 0x1800008E0UL)
+#define APECS_MEM_B8BAR                (IDENT_ADDR + 0x180000900UL)
+
+/* Bank x Configuration Register */
+#define APECS_MEM_B0BCR                (IDENT_ADDR + 0x180000A00UL)
+#define APECS_MEM_B1BCR                (IDENT_ADDR + 0x180000A20UL)
+#define APECS_MEM_B2BCR                (IDENT_ADDR + 0x180000A40UL)
+#define APECS_MEM_B3BCR                (IDENT_ADDR + 0x180000A60UL)
+#define APECS_MEM_B4BCR                (IDENT_ADDR + 0x180000A80UL)
+#define APECS_MEM_B5BCR                (IDENT_ADDR + 0x180000AA0UL)
+#define APECS_MEM_B6BCR                (IDENT_ADDR + 0x180000AC0UL)
+#define APECS_MEM_B7BCR                (IDENT_ADDR + 0x180000AE0UL)
+#define APECS_MEM_B8BCR                (IDENT_ADDR + 0x180000B00UL)
+
+/* Bank x Timing Register A */
+#define APECS_MEM_B0TRA                (IDENT_ADDR + 0x180000C00UL)
+#define APECS_MEM_B1TRA                (IDENT_ADDR + 0x180000C20UL)
+#define APECS_MEM_B2TRA                (IDENT_ADDR + 0x180000C40UL)
+#define APECS_MEM_B3TRA                (IDENT_ADDR + 0x180000C60UL)
+#define APECS_MEM_B4TRA                (IDENT_ADDR + 0x180000C80UL)
+#define APECS_MEM_B5TRA                (IDENT_ADDR + 0x180000CA0UL)
+#define APECS_MEM_B6TRA                (IDENT_ADDR + 0x180000CC0UL)
+#define APECS_MEM_B7TRA                (IDENT_ADDR + 0x180000CE0UL)
+#define APECS_MEM_B8TRA                (IDENT_ADDR + 0x180000D00UL)
+
+/* Bank x Timing Register B */
+#define APECS_MEM_B0TRB                 (IDENT_ADDR + 0x180000E00UL)
+#define APECS_MEM_B1TRB                (IDENT_ADDR + 0x180000E20UL)
+#define APECS_MEM_B2TRB                (IDENT_ADDR + 0x180000E40UL)
+#define APECS_MEM_B3TRB                (IDENT_ADDR + 0x180000E60UL)
+#define APECS_MEM_B4TRB                (IDENT_ADDR + 0x180000E80UL)
+#define APECS_MEM_B5TRB                (IDENT_ADDR + 0x180000EA0UL)
+#define APECS_MEM_B6TRB                (IDENT_ADDR + 0x180000EC0UL)
+#define APECS_MEM_B7TRB                (IDENT_ADDR + 0x180000EE0UL)
+#define APECS_MEM_B8TRB                (IDENT_ADDR + 0x180000F00UL)
+
+
+/*
+ * Memory spaces:
+ */
+#define APECS_IACK_SC                  (IDENT_ADDR + 0x1b0000000UL)
+#define APECS_CONF                     (IDENT_ADDR + 0x1e0000000UL)
+#define APECS_IO                       (IDENT_ADDR + 0x1c0000000UL)
+#define APECS_SPARSE_MEM               (IDENT_ADDR + 0x200000000UL)
+#define APECS_DENSE_MEM                        (IDENT_ADDR + 0x300000000UL)
+
+
+/*
+ * Bit definitions for I/O Controller status register 0:
+ */
+#define APECS_IOC_STAT0_CMD            0xf
+#define APECS_IOC_STAT0_ERR            (1<<4)
+#define APECS_IOC_STAT0_LOST           (1<<5)
+#define APECS_IOC_STAT0_THIT           (1<<6)
+#define APECS_IOC_STAT0_TREF           (1<<7)
+#define APECS_IOC_STAT0_CODE_SHIFT     8
+#define APECS_IOC_STAT0_CODE_MASK      0x7
+#define APECS_IOC_STAT0_P_NBR_SHIFT    13
+#define APECS_IOC_STAT0_P_NBR_MASK     0x7ffff
+
+#define APECS_HAE_ADDRESS              APECS_IOC_HAXR1
+
+
+/*
+ * Data structure for handling APECS machine checks:
+ */
+
+struct el_apecs_mikasa_sysdata_mcheck
+{
+       unsigned long coma_gcr;
+       unsigned long coma_edsr;
+       unsigned long coma_ter;
+       unsigned long coma_elar;
+       unsigned long coma_ehar;
+       unsigned long coma_ldlr;
+       unsigned long coma_ldhr;
+       unsigned long coma_base0;
+       unsigned long coma_base1;
+       unsigned long coma_base2;
+       unsigned long coma_base3;
+       unsigned long coma_cnfg0;
+       unsigned long coma_cnfg1;
+       unsigned long coma_cnfg2;
+       unsigned long coma_cnfg3;
+       unsigned long epic_dcsr;
+       unsigned long epic_pear;
+       unsigned long epic_sear;
+       unsigned long epic_tbr1;
+       unsigned long epic_tbr2;
+       unsigned long epic_pbr1;
+       unsigned long epic_pbr2;
+       unsigned long epic_pmr1;
+       unsigned long epic_pmr2;
+       unsigned long epic_harx1;
+       unsigned long epic_harx2;
+       unsigned long epic_pmlt;
+       unsigned long epic_tag0;
+       unsigned long epic_tag1;
+       unsigned long epic_tag2;
+       unsigned long epic_tag3;
+       unsigned long epic_tag4;
+       unsigned long epic_tag5;
+       unsigned long epic_tag6;
+       unsigned long epic_tag7;
+       unsigned long epic_data0;
+       unsigned long epic_data1;
+       unsigned long epic_data2;
+       unsigned long epic_data3;
+       unsigned long epic_data4;
+       unsigned long epic_data5;
+       unsigned long epic_data6;
+       unsigned long epic_data7;
+
+       unsigned long pceb_vid;
+       unsigned long pceb_did;
+       unsigned long pceb_revision;
+       unsigned long pceb_command;
+       unsigned long pceb_status;
+       unsigned long pceb_latency;
+       unsigned long pceb_control;
+       unsigned long pceb_arbcon;
+       unsigned long pceb_arbpri;
+
+       unsigned long esc_id;
+       unsigned long esc_revision;
+       unsigned long esc_int0;
+       unsigned long esc_int1;
+       unsigned long esc_elcr0;
+       unsigned long esc_elcr1;
+       unsigned long esc_last_eisa;
+       unsigned long esc_nmi_stat;
+
+       unsigned long pci_ir;
+       unsigned long pci_imr;
+       unsigned long svr_mgr;
+};
+
+/* This for the normal APECS machines.  */
+struct el_apecs_sysdata_mcheck
+{
+       unsigned long coma_gcr;
+       unsigned long coma_edsr;
+       unsigned long coma_ter;
+       unsigned long coma_elar;
+       unsigned long coma_ehar;
+       unsigned long coma_ldlr;
+       unsigned long coma_ldhr;
+       unsigned long coma_base0;
+       unsigned long coma_base1;
+       unsigned long coma_base2;
+       unsigned long coma_cnfg0;
+       unsigned long coma_cnfg1;
+       unsigned long coma_cnfg2;
+       unsigned long epic_dcsr;
+       unsigned long epic_pear;
+       unsigned long epic_sear;
+       unsigned long epic_tbr1;
+       unsigned long epic_tbr2;
+       unsigned long epic_pbr1;
+       unsigned long epic_pbr2;
+       unsigned long epic_pmr1;
+       unsigned long epic_pmr2;
+       unsigned long epic_harx1;
+       unsigned long epic_harx2;
+       unsigned long epic_pmlt;
+       unsigned long epic_tag0;
+       unsigned long epic_tag1;
+       unsigned long epic_tag2;
+       unsigned long epic_tag3;
+       unsigned long epic_tag4;
+       unsigned long epic_tag5;
+       unsigned long epic_tag6;
+       unsigned long epic_tag7;
+       unsigned long epic_data0;
+       unsigned long epic_data1;
+       unsigned long epic_data2;
+       unsigned long epic_data3;
+       unsigned long epic_data4;
+       unsigned long epic_data5;
+       unsigned long epic_data6;
+       unsigned long epic_data7;
+};
+
+struct el_apecs_procdata
+{
+       unsigned long paltemp[32];  /* PAL TEMP REGS. */
+       /* EV4-specific fields */
+       unsigned long exc_addr;     /* Address of excepting instruction. */
+       unsigned long exc_sum;      /* Summary of arithmetic traps. */
+       unsigned long exc_mask;     /* Exception mask (from exc_sum). */
+       unsigned long iccsr;        /* IBox hardware enables. */
+       unsigned long pal_base;     /* Base address for PALcode. */
+       unsigned long hier;         /* Hardware Interrupt Enable. */
+       unsigned long hirr;         /* Hardware Interrupt Request. */
+       unsigned long csr;          /* D-stream fault info. */
+       unsigned long dc_stat;      /* D-cache status (ECC/Parity Err). */
+       unsigned long dc_addr;      /* EV3 Phys Addr for ECC/DPERR. */
+       unsigned long abox_ctl;     /* ABox Control Register. */
+       unsigned long biu_stat;     /* BIU Status. */
+       unsigned long biu_addr;     /* BUI Address. */
+       unsigned long biu_ctl;      /* BIU Control. */
+       unsigned long fill_syndrome;/* For correcting ECC errors. */
+       unsigned long fill_addr;    /* Cache block which was being read */
+       unsigned long va;           /* Effective VA of fault or miss. */
+       unsigned long bc_tag;       /* Backup Cache Tag Probe Results.*/
+};
+
+
+#ifdef __KERNEL__
+
+#ifndef __EXTERN_INLINE
+#define __EXTERN_INLINE extern inline
+#define __IO_EXTERN_INLINE
+#endif
+
+/*
+ * I/O functions:
+ *
+ * Unlike Jensen, the APECS machines have no concept of local
+ * I/O---everything goes over the PCI bus.
+ *
+ * There is plenty room for optimization here.  In particular,
+ * the Alpha's insb/insw/extb/extw should be useful in moving
+ * data to/from the right byte-lanes.
+ */
+
+#define vip    volatile int __force *
+#define vuip   volatile unsigned int __force *
+#define vulp   volatile unsigned long __force *
+
+#define APECS_SET_HAE                                          \
+       do {                                                    \
+               if (addr >= (1UL << 24)) {                      \
+                       unsigned long msb = addr & 0xf8000000;  \
+                       addr -= msb;                            \
+                       set_hae(msb);                           \
+               }                                               \
+       } while (0)
+
+__EXTERN_INLINE unsigned int apecs_ioread8(void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       unsigned long result, base_and_type;
+
+       if (addr >= APECS_DENSE_MEM) {
+               addr -= APECS_DENSE_MEM;
+               APECS_SET_HAE;
+               base_and_type = APECS_SPARSE_MEM + 0x00;
+       } else {
+               addr -= APECS_IO;
+               base_and_type = APECS_IO + 0x00;
+       }
+
+       result = *(vip) ((addr << 5) + base_and_type);
+       return __kernel_extbl(result, addr & 3);
+}
+
+__EXTERN_INLINE void apecs_iowrite8(u8 b, void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       unsigned long w, base_and_type;
+
+       if (addr >= APECS_DENSE_MEM) {
+               addr -= APECS_DENSE_MEM;
+               APECS_SET_HAE;
+               base_and_type = APECS_SPARSE_MEM + 0x00;
+       } else {
+               addr -= APECS_IO;
+               base_and_type = APECS_IO + 0x00;
+       }
+
+       w = __kernel_insbl(b, addr & 3);
+       *(vuip) ((addr << 5) + base_and_type) = w;
+}
+
+__EXTERN_INLINE unsigned int apecs_ioread16(void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       unsigned long result, base_and_type;
+
+       if (addr >= APECS_DENSE_MEM) {
+               addr -= APECS_DENSE_MEM;
+               APECS_SET_HAE;
+               base_and_type = APECS_SPARSE_MEM + 0x08;
+       } else {
+               addr -= APECS_IO;
+               base_and_type = APECS_IO + 0x08;
+       }
+
+       result = *(vip) ((addr << 5) + base_and_type);
+       return __kernel_extwl(result, addr & 3);
+}
+
+__EXTERN_INLINE void apecs_iowrite16(u16 b, void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       unsigned long w, base_and_type;
+
+       if (addr >= APECS_DENSE_MEM) {
+               addr -= APECS_DENSE_MEM;
+               APECS_SET_HAE;
+               base_and_type = APECS_SPARSE_MEM + 0x08;
+       } else {
+               addr -= APECS_IO;
+               base_and_type = APECS_IO + 0x08;
+       }
+
+       w = __kernel_inswl(b, addr & 3);
+       *(vuip) ((addr << 5) + base_and_type) = w;
+}
+
+__EXTERN_INLINE unsigned int apecs_ioread32(void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       if (addr < APECS_DENSE_MEM)
+               addr = ((addr - APECS_IO) << 5) + APECS_IO + 0x18;
+       return *(vuip)addr;
+}
+
+__EXTERN_INLINE void apecs_iowrite32(u32 b, void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       if (addr < APECS_DENSE_MEM)
+               addr = ((addr - APECS_IO) << 5) + APECS_IO + 0x18;
+       *(vuip)addr = b;
+}
+
+__EXTERN_INLINE void __iomem *apecs_ioportmap(unsigned long addr)
+{
+       return (void __iomem *)(addr + APECS_IO);
+}
+
+__EXTERN_INLINE void __iomem *apecs_ioremap(unsigned long addr,
+                                           unsigned long size)
+{
+       return (void __iomem *)(addr + APECS_DENSE_MEM);
+}
+
+__EXTERN_INLINE int apecs_is_ioaddr(unsigned long addr)
+{
+       return addr >= IDENT_ADDR + 0x180000000UL;
+}
+
+__EXTERN_INLINE int apecs_is_mmio(const volatile void __iomem *addr)
+{
+       return (unsigned long)addr >= APECS_DENSE_MEM;
+}
+
+#undef APECS_SET_HAE
+
+#undef vip
+#undef vuip
+#undef vulp
+
+#undef __IO_PREFIX
+#define __IO_PREFIX            apecs
+#define apecs_trivial_io_bw    0
+#define apecs_trivial_io_lq    0
+#define apecs_trivial_rw_bw    2
+#define apecs_trivial_rw_lq    1
+#define apecs_trivial_iounmap  1
+#include <asm/io_trivial.h>
+
+#ifdef __IO_EXTERN_INLINE
+#undef __EXTERN_INLINE
+#undef __IO_EXTERN_INLINE
+#endif
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_APECS__H__ */
diff --git a/arch/alpha/include/asm/core_cia.h b/arch/alpha/include/asm/core_cia.h
new file mode 100644 (file)
index 0000000..9e0516c
--- /dev/null
@@ -0,0 +1,500 @@
+#ifndef __ALPHA_CIA__H__
+#define __ALPHA_CIA__H__
+
+/* Define to experiment with fitting everything into one 512MB HAE window.  */
+#define CIA_ONE_HAE_WINDOW 1
+
+#include <linux/types.h>
+#include <asm/compiler.h>
+
+/*
+ * CIA is the internal name for the 21171 chipset which provides
+ * memory controller and PCI access for the 21164 chip based systems.
+ * Also supported here is the 21172 (CIA-2) and 21174 (PYXIS).
+ *
+ * The lineage is a bit confused, since the 21174 was reportedly started
+ * from the 21171 Pass 1 mask, and so is missing bug fixes that appear
+ * in 21171 Pass 2 and 21172, but it also contains additional features.
+ *
+ * This file is based on:
+ *
+ * DECchip 21171 Core Logic Chipset
+ * Technical Reference Manual
+ *
+ * EC-QE18B-TE
+ *
+ * david.rusling@reo.mts.dec.com Initial Version.
+ *
+ */
+
+/*
+ * CIA ADDRESS BIT DEFINITIONS
+ *
+ *  3333 3333 3322 2222 2222 1111 1111 11
+ *  9876 5432 1098 7654 3210 9876 5432 1098 7654 3210
+ *  ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ *  1                                             000
+ *  ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ *  |                                             |\|
+ *  |                               Byte Enable --+ |
+ *  |                             Transfer Length --+
+ *  +-- IO space, not cached
+ *
+ *   Byte      Transfer
+ *   Enable    Length    Transfer  Byte    Address
+ *   adr<6:5>  adr<4:3>  Length    Enable  Adder
+ *   ---------------------------------------------
+ *      00        00      Byte      1110   0x000
+ *      01        00      Byte      1101   0x020
+ *      10        00      Byte      1011   0x040
+ *      11        00      Byte      0111   0x060
+ *
+ *      00        01      Word      1100   0x008
+ *      01        01      Word      1001   0x028 <= Not supported in this code.
+ *      10        01      Word      0011   0x048
+ *
+ *      00        10      Tribyte   1000   0x010
+ *      01        10      Tribyte   0001   0x030
+ *
+ *      10        11      Longword  0000   0x058
+ *
+ *      Note that byte enables are asserted low.
+ *
+ */
+
+#define CIA_MEM_R1_MASK 0x1fffffff  /* SPARSE Mem region 1 mask is 29 bits */
+#define CIA_MEM_R2_MASK 0x07ffffff  /* SPARSE Mem region 2 mask is 27 bits */
+#define CIA_MEM_R3_MASK 0x03ffffff  /* SPARSE Mem region 3 mask is 26 bits */
+
+/*
+ * 21171-CA Control and Status Registers
+ */
+#define CIA_IOC_CIA_REV                        (IDENT_ADDR + 0x8740000080UL)
+#  define CIA_REV_MASK                 0xff
+#define CIA_IOC_PCI_LAT                        (IDENT_ADDR + 0x87400000C0UL)
+#define CIA_IOC_CIA_CTRL               (IDENT_ADDR + 0x8740000100UL)
+#  define CIA_CTRL_PCI_EN              (1 << 0)
+#  define CIA_CTRL_PCI_LOCK_EN         (1 << 1)
+#  define CIA_CTRL_PCI_LOOP_EN         (1 << 2)
+#  define CIA_CTRL_FST_BB_EN           (1 << 3)
+#  define CIA_CTRL_PCI_MST_EN          (1 << 4)
+#  define CIA_CTRL_PCI_MEM_EN          (1 << 5)
+#  define CIA_CTRL_PCI_REQ64_EN                (1 << 6)
+#  define CIA_CTRL_PCI_ACK64_EN                (1 << 7)
+#  define CIA_CTRL_ADDR_PE_EN          (1 << 8)
+#  define CIA_CTRL_PERR_EN             (1 << 9)
+#  define CIA_CTRL_FILL_ERR_EN         (1 << 10)
+#  define CIA_CTRL_MCHK_ERR_EN         (1 << 11)
+#  define CIA_CTRL_ECC_CHK_EN          (1 << 12)
+#  define CIA_CTRL_ASSERT_IDLE_BC      (1 << 13)
+#  define CIA_CTRL_COM_IDLE_BC         (1 << 14)
+#  define CIA_CTRL_CSR_IOA_BYPASS      (1 << 15)
+#  define CIA_CTRL_IO_FLUSHREQ_EN      (1 << 16)
+#  define CIA_CTRL_CPU_FLUSHREQ_EN     (1 << 17)
+#  define CIA_CTRL_ARB_CPU_EN          (1 << 18)
+#  define CIA_CTRL_EN_ARB_LINK         (1 << 19)
+#  define CIA_CTRL_RD_TYPE_SHIFT       20
+#  define CIA_CTRL_RL_TYPE_SHIFT       24
+#  define CIA_CTRL_RM_TYPE_SHIFT       28
+#  define CIA_CTRL_EN_DMA_RD_PERF      (1 << 31)
+#define CIA_IOC_CIA_CNFG               (IDENT_ADDR + 0x8740000140UL)
+#  define CIA_CNFG_IOA_BWEN            (1 << 0)
+#  define CIA_CNFG_PCI_MWEN            (1 << 4)
+#  define CIA_CNFG_PCI_DWEN            (1 << 5)
+#  define CIA_CNFG_PCI_WLEN            (1 << 8)
+#define CIA_IOC_FLASH_CTRL             (IDENT_ADDR + 0x8740000200UL)
+#define CIA_IOC_HAE_MEM                        (IDENT_ADDR + 0x8740000400UL)
+#define CIA_IOC_HAE_IO                 (IDENT_ADDR + 0x8740000440UL)
+#define CIA_IOC_CFG                    (IDENT_ADDR + 0x8740000480UL)
+#define CIA_IOC_CACK_EN                        (IDENT_ADDR + 0x8740000600UL)
+#  define CIA_CACK_EN_LOCK_EN          (1 << 0)
+#  define CIA_CACK_EN_MB_EN            (1 << 1)
+#  define CIA_CACK_EN_SET_DIRTY_EN     (1 << 2)
+#  define CIA_CACK_EN_BC_VICTIM_EN     (1 << 3)
+
+
+/*
+ * 21171-CA Diagnostic Registers
+ */
+#define CIA_IOC_CIA_DIAG               (IDENT_ADDR + 0x8740002000UL)
+#define CIA_IOC_DIAG_CHECK             (IDENT_ADDR + 0x8740003000UL)
+
+/*
+ * 21171-CA Performance Monitor registers
+ */
+#define CIA_IOC_PERF_MONITOR           (IDENT_ADDR + 0x8740004000UL)
+#define CIA_IOC_PERF_CONTROL           (IDENT_ADDR + 0x8740004040UL)
+
+/*
+ * 21171-CA Error registers
+ */
+#define CIA_IOC_CPU_ERR0               (IDENT_ADDR + 0x8740008000UL)
+#define CIA_IOC_CPU_ERR1               (IDENT_ADDR + 0x8740008040UL)
+#define CIA_IOC_CIA_ERR                        (IDENT_ADDR + 0x8740008200UL)
+#  define CIA_ERR_COR_ERR              (1 << 0)
+#  define CIA_ERR_UN_COR_ERR           (1 << 1)
+#  define CIA_ERR_CPU_PE               (1 << 2)
+#  define CIA_ERR_MEM_NEM              (1 << 3)
+#  define CIA_ERR_PCI_SERR             (1 << 4)
+#  define CIA_ERR_PERR                 (1 << 5)
+#  define CIA_ERR_PCI_ADDR_PE          (1 << 6)
+#  define CIA_ERR_RCVD_MAS_ABT         (1 << 7)
+#  define CIA_ERR_RCVD_TAR_ABT         (1 << 8)
+#  define CIA_ERR_PA_PTE_INV           (1 << 9)
+#  define CIA_ERR_FROM_WRT_ERR         (1 << 10)
+#  define CIA_ERR_IOA_TIMEOUT          (1 << 11)
+#  define CIA_ERR_LOST_CORR_ERR                (1 << 16)
+#  define CIA_ERR_LOST_UN_CORR_ERR     (1 << 17)
+#  define CIA_ERR_LOST_CPU_PE          (1 << 18)
+#  define CIA_ERR_LOST_MEM_NEM         (1 << 19)
+#  define CIA_ERR_LOST_PERR            (1 << 21)
+#  define CIA_ERR_LOST_PCI_ADDR_PE     (1 << 22)
+#  define CIA_ERR_LOST_RCVD_MAS_ABT    (1 << 23)
+#  define CIA_ERR_LOST_RCVD_TAR_ABT    (1 << 24)
+#  define CIA_ERR_LOST_PA_PTE_INV      (1 << 25)
+#  define CIA_ERR_LOST_FROM_WRT_ERR    (1 << 26)
+#  define CIA_ERR_LOST_IOA_TIMEOUT     (1 << 27)
+#  define CIA_ERR_VALID                        (1 << 31)
+#define CIA_IOC_CIA_STAT               (IDENT_ADDR + 0x8740008240UL)
+#define CIA_IOC_ERR_MASK               (IDENT_ADDR + 0x8740008280UL)
+#define CIA_IOC_CIA_SYN                        (IDENT_ADDR + 0x8740008300UL)
+#define CIA_IOC_MEM_ERR0               (IDENT_ADDR + 0x8740008400UL)
+#define CIA_IOC_MEM_ERR1               (IDENT_ADDR + 0x8740008440UL)
+#define CIA_IOC_PCI_ERR0               (IDENT_ADDR + 0x8740008800UL)
+#define CIA_IOC_PCI_ERR1               (IDENT_ADDR + 0x8740008840UL)
+#define CIA_IOC_PCI_ERR3               (IDENT_ADDR + 0x8740008880UL)
+
+/*
+ * 21171-CA System configuration registers
+ */
+#define CIA_IOC_MCR                    (IDENT_ADDR + 0x8750000000UL)
+#define CIA_IOC_MBA0                   (IDENT_ADDR + 0x8750000600UL)
+#define CIA_IOC_MBA2                   (IDENT_ADDR + 0x8750000680UL)
+#define CIA_IOC_MBA4                   (IDENT_ADDR + 0x8750000700UL)
+#define CIA_IOC_MBA6                   (IDENT_ADDR + 0x8750000780UL)
+#define CIA_IOC_MBA8                   (IDENT_ADDR + 0x8750000800UL)
+#define CIA_IOC_MBAA                   (IDENT_ADDR + 0x8750000880UL)
+#define CIA_IOC_MBAC                   (IDENT_ADDR + 0x8750000900UL)
+#define CIA_IOC_MBAE                   (IDENT_ADDR + 0x8750000980UL)
+#define CIA_IOC_TMG0                   (IDENT_ADDR + 0x8750000B00UL)
+#define CIA_IOC_TMG1                   (IDENT_ADDR + 0x8750000B40UL)
+#define CIA_IOC_TMG2                   (IDENT_ADDR + 0x8750000B80UL)
+
+/*
+ * 2117A-CA PCI Address and Scatter-Gather Registers.
+ */
+#define CIA_IOC_PCI_TBIA               (IDENT_ADDR + 0x8760000100UL)
+
+#define CIA_IOC_PCI_W0_BASE            (IDENT_ADDR + 0x8760000400UL)
+#define CIA_IOC_PCI_W0_MASK            (IDENT_ADDR + 0x8760000440UL)
+#define CIA_IOC_PCI_T0_BASE            (IDENT_ADDR + 0x8760000480UL)
+
+#define CIA_IOC_PCI_W1_BASE            (IDENT_ADDR + 0x8760000500UL)
+#define CIA_IOC_PCI_W1_MASK            (IDENT_ADDR + 0x8760000540UL)
+#define CIA_IOC_PCI_T1_BASE            (IDENT_ADDR + 0x8760000580UL)
+
+#define CIA_IOC_PCI_W2_BASE            (IDENT_ADDR + 0x8760000600UL)
+#define CIA_IOC_PCI_W2_MASK            (IDENT_ADDR + 0x8760000640UL)
+#define CIA_IOC_PCI_T2_BASE            (IDENT_ADDR + 0x8760000680UL)
+
+#define CIA_IOC_PCI_W3_BASE            (IDENT_ADDR + 0x8760000700UL)
+#define CIA_IOC_PCI_W3_MASK            (IDENT_ADDR + 0x8760000740UL)
+#define CIA_IOC_PCI_T3_BASE            (IDENT_ADDR + 0x8760000780UL)
+
+#define CIA_IOC_PCI_Wn_BASE(N) (IDENT_ADDR + 0x8760000400UL + (N)*0x100) 
+#define CIA_IOC_PCI_Wn_MASK(N) (IDENT_ADDR + 0x8760000440UL + (N)*0x100) 
+#define CIA_IOC_PCI_Tn_BASE(N) (IDENT_ADDR + 0x8760000480UL + (N)*0x100) 
+
+#define CIA_IOC_PCI_W_DAC              (IDENT_ADDR + 0x87600007C0UL)
+
+/*
+ * 2117A-CA Address Translation Registers.
+ */
+
+/* 8 tag registers, the first 4 of which are lockable.  */
+#define CIA_IOC_TB_TAGn(n) \
+       (IDENT_ADDR + 0x8760000800UL + (n)*0x40)
+
+/* 4 page registers per tag register.  */
+#define CIA_IOC_TBn_PAGEm(n,m) \
+       (IDENT_ADDR + 0x8760001000UL + (n)*0x100 + (m)*0x40)
+
+/*
+ * Memory spaces:
+ */
+#define CIA_IACK_SC                    (IDENT_ADDR + 0x8720000000UL)
+#define CIA_CONF                       (IDENT_ADDR + 0x8700000000UL)
+#define CIA_IO                         (IDENT_ADDR + 0x8580000000UL)
+#define CIA_SPARSE_MEM                 (IDENT_ADDR + 0x8000000000UL)
+#define CIA_SPARSE_MEM_R2              (IDENT_ADDR + 0x8400000000UL)
+#define CIA_SPARSE_MEM_R3              (IDENT_ADDR + 0x8500000000UL)
+#define CIA_DENSE_MEM                  (IDENT_ADDR + 0x8600000000UL)
+#define CIA_BW_MEM                     (IDENT_ADDR + 0x8800000000UL)
+#define CIA_BW_IO                      (IDENT_ADDR + 0x8900000000UL)
+#define CIA_BW_CFG_0                   (IDENT_ADDR + 0x8a00000000UL)
+#define CIA_BW_CFG_1                   (IDENT_ADDR + 0x8b00000000UL)
+
+/*
+ * ALCOR's GRU ASIC registers
+ */
+#define GRU_INT_REQ                    (IDENT_ADDR + 0x8780000000UL)
+#define GRU_INT_MASK                   (IDENT_ADDR + 0x8780000040UL)
+#define GRU_INT_EDGE                   (IDENT_ADDR + 0x8780000080UL)
+#define GRU_INT_HILO                   (IDENT_ADDR + 0x87800000C0UL)
+#define GRU_INT_CLEAR                  (IDENT_ADDR + 0x8780000100UL)
+
+#define GRU_CACHE_CNFG                 (IDENT_ADDR + 0x8780000200UL)
+#define GRU_SCR                                (IDENT_ADDR + 0x8780000300UL)
+#define GRU_LED                                (IDENT_ADDR + 0x8780000800UL)
+#define GRU_RESET                      (IDENT_ADDR + 0x8780000900UL)
+
+#define ALCOR_GRU_INT_REQ_BITS         0x800fffffUL
+#define XLT_GRU_INT_REQ_BITS           0x80003fffUL
+#define GRU_INT_REQ_BITS               (alpha_mv.sys.cia.gru_int_req_bits+0)
+
+/*
+ * PYXIS interrupt control registers
+ */
+#define PYXIS_INT_REQ                  (IDENT_ADDR + 0x87A0000000UL)
+#define PYXIS_INT_MASK                 (IDENT_ADDR + 0x87A0000040UL)
+#define PYXIS_INT_HILO                 (IDENT_ADDR + 0x87A00000C0UL)
+#define PYXIS_INT_ROUTE                        (IDENT_ADDR + 0x87A0000140UL)
+#define PYXIS_GPO                      (IDENT_ADDR + 0x87A0000180UL)
+#define PYXIS_INT_CNFG                 (IDENT_ADDR + 0x87A00001C0UL)
+#define PYXIS_RT_COUNT                 (IDENT_ADDR + 0x87A0000200UL)
+#define PYXIS_INT_TIME                 (IDENT_ADDR + 0x87A0000240UL)
+#define PYXIS_IIC_CTRL                 (IDENT_ADDR + 0x87A00002C0UL)
+#define PYXIS_RESET                    (IDENT_ADDR + 0x8780000900UL)
+
+/* Offset between ram physical addresses and pci64 DAC bus addresses.  */
+#define PYXIS_DAC_OFFSET               (1UL << 40)
+
+/*
+ * Data structure for handling CIA machine checks.
+ */
+
+/* System-specific info.  */
+struct el_CIA_sysdata_mcheck {
+       unsigned long   cpu_err0;
+       unsigned long   cpu_err1;
+       unsigned long   cia_err;
+       unsigned long   cia_stat;
+       unsigned long   err_mask;
+       unsigned long   cia_syn;
+       unsigned long   mem_err0;
+       unsigned long   mem_err1;
+       unsigned long   pci_err0;
+       unsigned long   pci_err1;
+       unsigned long   pci_err2;
+};
+
+
+#ifdef __KERNEL__
+
+#ifndef __EXTERN_INLINE
+/* Do not touch, this should *NOT* be static inline */
+#define __EXTERN_INLINE extern inline
+#define __IO_EXTERN_INLINE
+#endif
+
+/*
+ * I/O functions:
+ *
+ * CIA (the 2117x PCI/memory support chipset for the EV5 (21164)
+ * series of processors uses a sparse address mapping scheme to
+ * get at PCI memory and I/O.
+ */
+
+/*
+ * Memory functions.  64-bit and 32-bit accesses are done through
+ * dense memory space, everything else through sparse space.
+ *
+ * For reading and writing 8 and 16 bit quantities we need to
+ * go through one of the three sparse address mapping regions
+ * and use the HAE_MEM CSR to provide some bits of the address.
+ * The following few routines use only sparse address region 1
+ * which gives 1Gbyte of accessible space which relates exactly
+ * to the amount of PCI memory mapping *into* system address space.
+ * See p 6-17 of the specification but it looks something like this:
+ *
+ * 21164 Address:
+ *
+ *          3         2         1
+ * 9876543210987654321098765432109876543210
+ * 1ZZZZ0.PCI.QW.Address............BBLL
+ *
+ * ZZ = SBZ
+ * BB = Byte offset
+ * LL = Transfer length
+ *
+ * PCI Address:
+ *
+ * 3         2         1
+ * 10987654321098765432109876543210
+ * HHH....PCI.QW.Address........ 00
+ *
+ * HHH = 31:29 HAE_MEM CSR
+ *
+ */
+
+#define vip    volatile int __force *
+#define vuip   volatile unsigned int __force *
+#define vulp   volatile unsigned long __force *
+
+__EXTERN_INLINE unsigned int cia_ioread8(void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       unsigned long result, base_and_type;
+
+       if (addr >= CIA_DENSE_MEM)
+               base_and_type = CIA_SPARSE_MEM + 0x00;
+       else
+               base_and_type = CIA_IO + 0x00;
+
+       /* We can use CIA_MEM_R1_MASK for io ports too, since it is large
+          enough to cover all io ports, and smaller than CIA_IO.  */
+       addr &= CIA_MEM_R1_MASK;
+       result = *(vip) ((addr << 5) + base_and_type);
+       return __kernel_extbl(result, addr & 3);
+}
+
+__EXTERN_INLINE void cia_iowrite8(u8 b, void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       unsigned long w, base_and_type;
+
+       if (addr >= CIA_DENSE_MEM)
+               base_and_type = CIA_SPARSE_MEM + 0x00;
+       else
+               base_and_type = CIA_IO + 0x00;
+
+       addr &= CIA_MEM_R1_MASK;
+       w = __kernel_insbl(b, addr & 3);
+       *(vuip) ((addr << 5) + base_and_type) = w;
+}
+
+__EXTERN_INLINE unsigned int cia_ioread16(void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       unsigned long result, base_and_type;
+
+       if (addr >= CIA_DENSE_MEM)
+               base_and_type = CIA_SPARSE_MEM + 0x08;
+       else
+               base_and_type = CIA_IO + 0x08;
+
+       addr &= CIA_MEM_R1_MASK;
+       result = *(vip) ((addr << 5) + base_and_type);
+       return __kernel_extwl(result, addr & 3);
+}
+
+__EXTERN_INLINE void cia_iowrite16(u16 b, void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       unsigned long w, base_and_type;
+
+       if (addr >= CIA_DENSE_MEM)
+               base_and_type = CIA_SPARSE_MEM + 0x08;
+       else
+               base_and_type = CIA_IO + 0x08;
+
+       addr &= CIA_MEM_R1_MASK;
+       w = __kernel_inswl(b, addr & 3);
+       *(vuip) ((addr << 5) + base_and_type) = w;
+}
+
+__EXTERN_INLINE unsigned int cia_ioread32(void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       if (addr < CIA_DENSE_MEM)
+               addr = ((addr - CIA_IO) << 5) + CIA_IO + 0x18;
+       return *(vuip)addr;
+}
+
+__EXTERN_INLINE void cia_iowrite32(u32 b, void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       if (addr < CIA_DENSE_MEM)
+               addr = ((addr - CIA_IO) << 5) + CIA_IO + 0x18;
+       *(vuip)addr = b;
+}
+
+__EXTERN_INLINE void __iomem *cia_ioportmap(unsigned long addr)
+{
+       return (void __iomem *)(addr + CIA_IO);
+}
+
+__EXTERN_INLINE void __iomem *cia_ioremap(unsigned long addr,
+                                         unsigned long size)
+{
+       return (void __iomem *)(addr + CIA_DENSE_MEM);
+}
+
+__EXTERN_INLINE int cia_is_ioaddr(unsigned long addr)
+{
+       return addr >= IDENT_ADDR + 0x8000000000UL;
+}
+
+__EXTERN_INLINE int cia_is_mmio(const volatile void __iomem *addr)
+{
+       return (unsigned long)addr >= CIA_DENSE_MEM;
+}
+
+__EXTERN_INLINE void __iomem *cia_bwx_ioportmap(unsigned long addr)
+{
+       return (void __iomem *)(addr + CIA_BW_IO);
+}
+
+__EXTERN_INLINE void __iomem *cia_bwx_ioremap(unsigned long addr,
+                                             unsigned long size)
+{
+       return (void __iomem *)(addr + CIA_BW_MEM);
+}
+
+__EXTERN_INLINE int cia_bwx_is_ioaddr(unsigned long addr)
+{
+       return addr >= IDENT_ADDR + 0x8000000000UL;
+}
+
+__EXTERN_INLINE int cia_bwx_is_mmio(const volatile void __iomem *addr)
+{
+       return (unsigned long)addr < CIA_BW_IO;
+}
+
+#undef vip
+#undef vuip
+#undef vulp
+
+#undef __IO_PREFIX
+#define __IO_PREFIX            cia
+#define cia_trivial_rw_bw      2
+#define cia_trivial_rw_lq      1
+#define cia_trivial_io_bw      0
+#define cia_trivial_io_lq      0
+#define cia_trivial_iounmap    1
+#include <asm/io_trivial.h>
+
+#undef __IO_PREFIX
+#define __IO_PREFIX            cia_bwx
+#define cia_bwx_trivial_rw_bw  1
+#define cia_bwx_trivial_rw_lq  1
+#define cia_bwx_trivial_io_bw  1
+#define cia_bwx_trivial_io_lq  1
+#define cia_bwx_trivial_iounmap        1
+#include <asm/io_trivial.h>
+
+#undef __IO_PREFIX
+#ifdef CONFIG_ALPHA_PYXIS
+#define __IO_PREFIX            cia_bwx
+#else
+#define __IO_PREFIX            cia
+#endif
+
+#ifdef __IO_EXTERN_INLINE
+#undef __EXTERN_INLINE
+#undef __IO_EXTERN_INLINE
+#endif
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_CIA__H__ */
diff --git a/arch/alpha/include/asm/core_irongate.h b/arch/alpha/include/asm/core_irongate.h
new file mode 100644 (file)
index 0000000..24b2db5
--- /dev/null
@@ -0,0 +1,232 @@
+#ifndef __ALPHA_IRONGATE__H__
+#define __ALPHA_IRONGATE__H__
+
+#include <linux/types.h>
+#include <asm/compiler.h>
+
+/*
+ * IRONGATE is the internal name for the AMD-751 K7 core logic chipset
+ * which provides memory controller and PCI access for NAUTILUS-based
+ * EV6 (21264) systems.
+ *
+ * This file is based on:
+ *
+ * IronGate management library, (c) 1999 Alpha Processor, Inc.
+ * Copyright (C) 1999 Alpha Processor, Inc.,
+ *     (David Daniel, Stig Telfer, Soohoon Lee)
+ */
+
+/*
+ * The 21264 supports, and internally recognizes, a 44-bit physical
+ * address space that is divided equally between memory address space
+ * and I/O address space. Memory address space resides in the lower
+ * half of the physical address space (PA[43]=0) and I/O address space
+ * resides in the upper half of the physical address space (PA[43]=1).
+ */
+
+/*
+ * Irongate CSR map.  Some of the CSRs are 8 or 16 bits, but all access
+ * through the routines given is 32-bit.
+ *
+ * The first 0x40 bytes are standard as per the PCI spec.
+ */
+
+typedef volatile __u32 igcsr32;
+
+typedef struct {
+       igcsr32 dev_vendor;             /* 0x00 - device ID, vendor ID */
+       igcsr32 stat_cmd;               /* 0x04 - status, command */
+       igcsr32 class;                  /* 0x08 - class code, rev ID */
+       igcsr32 latency;                /* 0x0C - header type, PCI latency */
+       igcsr32 bar0;                   /* 0x10 - BAR0 - AGP */
+       igcsr32 bar1;                   /* 0x14 - BAR1 - GART */
+       igcsr32 bar2;                   /* 0x18 - Power Management reg block */
+
+       igcsr32 rsrvd0[6];              /* 0x1C-0x33 reserved */
+
+       igcsr32 capptr;                 /* 0x34 - Capabilities pointer */
+
+       igcsr32 rsrvd1[2];              /* 0x38-0x3F reserved */
+
+       igcsr32 bacsr10;                /* 0x40 - base address chip selects */
+       igcsr32 bacsr32;                /* 0x44 - base address chip selects */
+       igcsr32 bacsr54_eccms761;       /* 0x48 - 751: base addr. chip selects
+                                                 761: ECC, mode/status */
+
+       igcsr32 rsrvd2[1];              /* 0x4C-0x4F reserved */
+
+       igcsr32 drammap;                /* 0x50 - address mapping control */
+       igcsr32 dramtm;                 /* 0x54 - timing, driver strength */
+       igcsr32 dramms;                 /* 0x58 - DRAM mode/status */
+
+       igcsr32 rsrvd3[1];              /* 0x5C-0x5F reserved */
+
+       igcsr32 biu0;                   /* 0x60 - bus interface unit */
+       igcsr32 biusip;                 /* 0x64 - Serial initialisation pkt */
+
+       igcsr32 rsrvd4[2];              /* 0x68-0x6F reserved */
+
+       igcsr32 mro;                    /* 0x70 - memory request optimiser */
+
+       igcsr32 rsrvd5[3];              /* 0x74-0x7F reserved */
+
+       igcsr32 whami;                  /* 0x80 - who am I */
+       igcsr32 pciarb;                 /* 0x84 - PCI arbitration control */
+       igcsr32 pcicfg;                 /* 0x88 - PCI config status */
+
+       igcsr32 rsrvd6[4];              /* 0x8C-0x9B reserved */
+
+       igcsr32 pci_mem;                /* 0x9C - PCI top of memory,
+                                                 761 only */
+
+       /* AGP (bus 1) control registers */
+       igcsr32 agpcap;                 /* 0xA0 - AGP Capability Identifier */
+       igcsr32 agpstat;                /* 0xA4 - AGP status register */
+       igcsr32 agpcmd;                 /* 0xA8 - AGP control register */
+       igcsr32 agpva;                  /* 0xAC - AGP Virtual Address Space */
+       igcsr32 agpmode;                /* 0xB0 - AGP/GART mode control */
+} Irongate0;
+
+
+typedef struct {
+
+       igcsr32 dev_vendor;             /* 0x00 - Device and Vendor IDs */
+       igcsr32 stat_cmd;               /* 0x04 - Status and Command regs */
+       igcsr32 class;                  /* 0x08 - subclass, baseclass etc */
+       igcsr32 htype;                  /* 0x0C - header type (at 0x0E) */
+       igcsr32 rsrvd0[2];              /* 0x10-0x17 reserved */
+       igcsr32 busnos;                 /* 0x18 - Primary, secondary bus nos */
+       igcsr32 io_baselim_regs;        /* 0x1C - IO base, IO lim, AGP status */
+       igcsr32 mem_baselim;            /* 0x20 - memory base, memory lim */
+       igcsr32 pfmem_baselim;          /* 0x24 - prefetchable base, lim */
+       igcsr32 rsrvd1[2];              /* 0x28-0x2F reserved */
+       igcsr32 io_baselim;             /* 0x30 - IO base, IO limit */
+       igcsr32 rsrvd2[2];              /* 0x34-0x3B - reserved */
+       igcsr32 interrupt;              /* 0x3C - interrupt, PCI bridge ctrl */
+
+} Irongate1;
+
+extern igcsr32 *IronECC;
+
+/*
+ * Memory spaces:
+ */
+
+/* Irongate is consistent with a subset of the Tsunami memory map */
+#ifdef USE_48_BIT_KSEG
+#define IRONGATE_BIAS 0x80000000000UL
+#else
+#define IRONGATE_BIAS 0x10000000000UL
+#endif
+
+
+#define IRONGATE_MEM           (IDENT_ADDR | IRONGATE_BIAS | 0x000000000UL)
+#define IRONGATE_IACK_SC       (IDENT_ADDR | IRONGATE_BIAS | 0x1F8000000UL)
+#define IRONGATE_IO            (IDENT_ADDR | IRONGATE_BIAS | 0x1FC000000UL)
+#define IRONGATE_CONF          (IDENT_ADDR | IRONGATE_BIAS | 0x1FE000000UL)
+
+/*
+ * PCI Configuration space accesses are formed like so:
+ *
+ * 0x1FE << 24 |  : 2 2 2 2 1 1 1 1 : 1 1 1 1 1 1 0 0 : 0 0 0 0 0 0 0 0 :
+ *                : 3 2 1 0 9 8 7 6 : 5 4 3 2 1 0 9 8 : 7 6 5 4 3 2 1 0 :
+ *                  ---bus numer---   -device-- -fun-   ---register----
+ */
+
+#define IGCSR(dev,fun,reg)     ( IRONGATE_CONF | \
+                               ((dev)<<11) | \
+                               ((fun)<<8) | \
+                               (reg) )
+
+#define IRONGATE0              ((Irongate0 *) IGCSR(0, 0, 0))
+#define IRONGATE1              ((Irongate1 *) IGCSR(1, 0, 0))
+
+/*
+ * Data structure for handling IRONGATE machine checks:
+ * This is the standard OSF logout frame
+ */
+
+#define SCB_Q_SYSERR   0x620                   /* OSF definitions */
+#define SCB_Q_PROCERR  0x630
+#define SCB_Q_SYSMCHK  0x660
+#define SCB_Q_PROCMCHK 0x670
+
+struct el_IRONGATE_sysdata_mcheck {
+       __u32 FrameSize;                 /* Bytes, including this field */
+       __u32 FrameFlags;                /* <31> = Retry, <30> = Second Error */
+       __u32 CpuOffset;                 /* Offset to CPU-specific into */
+       __u32 SystemOffset;              /* Offset to system-specific info */
+       __u32 MCHK_Code;
+       __u32 MCHK_Frame_Rev;
+       __u64 I_STAT;
+       __u64 DC_STAT;
+       __u64 C_ADDR;
+       __u64 DC1_SYNDROME;
+       __u64 DC0_SYNDROME;
+       __u64 C_STAT;
+       __u64 C_STS;
+       __u64 RESERVED0;
+       __u64 EXC_ADDR;
+       __u64 IER_CM;
+       __u64 ISUM;
+       __u64 MM_STAT;
+       __u64 PAL_BASE;
+       __u64 I_CTL;
+       __u64 PCTX;
+};
+
+
+#ifdef __KERNEL__
+
+#ifndef __EXTERN_INLINE
+#define __EXTERN_INLINE extern inline
+#define __IO_EXTERN_INLINE
+#endif
+
+/*
+ * I/O functions:
+ *
+ * IRONGATE (AMD-751) PCI/memory support chip for the EV6 (21264) and
+ * K7 can only use linear accesses to get at PCI memory and I/O spaces.
+ */
+
+/*
+ * Memory functions.  All accesses are done through linear space.
+ */
+
+__EXTERN_INLINE void __iomem *irongate_ioportmap(unsigned long addr)
+{
+       return (void __iomem *)(addr + IRONGATE_IO);
+}
+
+extern void __iomem *irongate_ioremap(unsigned long addr, unsigned long size);
+extern void irongate_iounmap(volatile void __iomem *addr);
+
+__EXTERN_INLINE int irongate_is_ioaddr(unsigned long addr)
+{
+       return addr >= IRONGATE_MEM;
+}
+
+__EXTERN_INLINE int irongate_is_mmio(const volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long)xaddr;
+       return addr < IRONGATE_IO || addr >= IRONGATE_CONF;
+}
+
+#undef __IO_PREFIX
+#define __IO_PREFIX                    irongate
+#define irongate_trivial_rw_bw         1
+#define irongate_trivial_rw_lq         1
+#define irongate_trivial_io_bw         1
+#define irongate_trivial_io_lq         1
+#define irongate_trivial_iounmap       0
+#include <asm/io_trivial.h>
+
+#ifdef __IO_EXTERN_INLINE
+#undef __EXTERN_INLINE
+#undef __IO_EXTERN_INLINE
+#endif
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_IRONGATE__H__ */
diff --git a/arch/alpha/include/asm/core_lca.h b/arch/alpha/include/asm/core_lca.h
new file mode 100644 (file)
index 0000000..f7cb4b4
--- /dev/null
@@ -0,0 +1,361 @@
+#ifndef __ALPHA_LCA__H__
+#define __ALPHA_LCA__H__
+
+#include <asm/system.h>
+#include <asm/compiler.h>
+
+/*
+ * Low Cost Alpha (LCA) definitions (these apply to 21066 and 21068,
+ * for example).
+ *
+ * This file is based on:
+ *
+ *     DECchip 21066 and DECchip 21068 Alpha AXP Microprocessors
+ *     Hardware Reference Manual; Digital Equipment Corp.; May 1994;
+ *     Maynard, MA; Order Number: EC-N2681-71.
+ */
+
+/*
+ * NOTE: The LCA uses a Host Address Extension (HAE) register to access
+ *      PCI addresses that are beyond the first 27 bits of address
+ *      space.  Updating the HAE requires an external cycle (and
+ *      a memory barrier), which tends to be slow.  Instead of updating
+ *      it on each sparse memory access, we keep the current HAE value
+ *      cached in variable cache_hae.  Only if the cached HAE differs
+ *      from the desired HAE value do we actually updated HAE register.
+ *      The HAE register is preserved by the interrupt handler entry/exit
+ *      code, so this scheme works even in the presence of interrupts.
+ *
+ * Dense memory space doesn't require the HAE, but is restricted to
+ * aligned 32 and 64 bit accesses.  Special Cycle and Interrupt
+ * Acknowledge cycles may also require the use of the HAE.  The LCA
+ * limits I/O address space to the bottom 24 bits of address space,
+ * but this easily covers the 16 bit ISA I/O address space.
+ */
+
+/*
+ * NOTE 2! The memory operations do not set any memory barriers, as
+ * it's not needed for cases like a frame buffer that is essentially
+ * memory-like.  You need to do them by hand if the operations depend
+ * on ordering.
+ *
+ * Similarly, the port I/O operations do a "mb" only after a write
+ * operation: if an mb is needed before (as in the case of doing
+ * memory mapped I/O first, and then a port I/O operation to the same
+ * device), it needs to be done by hand.
+ *
+ * After the above has bitten me 100 times, I'll give up and just do
+ * the mb all the time, but right now I'm hoping this will work out.
+ * Avoiding mb's may potentially be a noticeable speed improvement,
+ * but I can't honestly say I've tested it.
+ *
+ * Handling interrupts that need to do mb's to synchronize to
+ * non-interrupts is another fun race area.  Don't do it (because if
+ * you do, I'll have to do *everything* with interrupts disabled,
+ * ugh).
+ */
+
+/*
+ * Memory Controller registers:
+ */
+#define LCA_MEM_BCR0           (IDENT_ADDR + 0x120000000UL)
+#define LCA_MEM_BCR1           (IDENT_ADDR + 0x120000008UL)
+#define LCA_MEM_BCR2           (IDENT_ADDR + 0x120000010UL)
+#define LCA_MEM_BCR3           (IDENT_ADDR + 0x120000018UL)
+#define LCA_MEM_BMR0           (IDENT_ADDR + 0x120000020UL)
+#define LCA_MEM_BMR1           (IDENT_ADDR + 0x120000028UL)
+#define LCA_MEM_BMR2           (IDENT_ADDR + 0x120000030UL)
+#define LCA_MEM_BMR3           (IDENT_ADDR + 0x120000038UL)
+#define LCA_MEM_BTR0           (IDENT_ADDR + 0x120000040UL)
+#define LCA_MEM_BTR1           (IDENT_ADDR + 0x120000048UL)
+#define LCA_MEM_BTR2           (IDENT_ADDR + 0x120000050UL)
+#define LCA_MEM_BTR3           (IDENT_ADDR + 0x120000058UL)
+#define LCA_MEM_GTR            (IDENT_ADDR + 0x120000060UL)
+#define LCA_MEM_ESR            (IDENT_ADDR + 0x120000068UL)
+#define LCA_MEM_EAR            (IDENT_ADDR + 0x120000070UL)
+#define LCA_MEM_CAR            (IDENT_ADDR + 0x120000078UL)
+#define LCA_MEM_VGR            (IDENT_ADDR + 0x120000080UL)
+#define LCA_MEM_PLM            (IDENT_ADDR + 0x120000088UL)
+#define LCA_MEM_FOR            (IDENT_ADDR + 0x120000090UL)
+
+/*
+ * I/O Controller registers:
+ */
+#define LCA_IOC_HAE            (IDENT_ADDR + 0x180000000UL)
+#define LCA_IOC_CONF           (IDENT_ADDR + 0x180000020UL)
+#define LCA_IOC_STAT0          (IDENT_ADDR + 0x180000040UL)
+#define LCA_IOC_STAT1          (IDENT_ADDR + 0x180000060UL)
+#define LCA_IOC_TBIA           (IDENT_ADDR + 0x180000080UL)
+#define LCA_IOC_TB_ENA         (IDENT_ADDR + 0x1800000a0UL)
+#define LCA_IOC_SFT_RST                (IDENT_ADDR + 0x1800000c0UL)
+#define LCA_IOC_PAR_DIS                (IDENT_ADDR + 0x1800000e0UL)
+#define LCA_IOC_W_BASE0                (IDENT_ADDR + 0x180000100UL)
+#define LCA_IOC_W_BASE1                (IDENT_ADDR + 0x180000120UL)
+#define LCA_IOC_W_MASK0                (IDENT_ADDR + 0x180000140UL)
+#define LCA_IOC_W_MASK1                (IDENT_ADDR + 0x180000160UL)
+#define LCA_IOC_T_BASE0                (IDENT_ADDR + 0x180000180UL)
+#define LCA_IOC_T_BASE1                (IDENT_ADDR + 0x1800001a0UL)
+#define LCA_IOC_TB_TAG0                (IDENT_ADDR + 0x188000000UL)
+#define LCA_IOC_TB_TAG1                (IDENT_ADDR + 0x188000020UL)
+#define LCA_IOC_TB_TAG2                (IDENT_ADDR + 0x188000040UL)
+#define LCA_IOC_TB_TAG3                (IDENT_ADDR + 0x188000060UL)
+#define LCA_IOC_TB_TAG4                (IDENT_ADDR + 0x188000070UL)
+#define LCA_IOC_TB_TAG5                (IDENT_ADDR + 0x1880000a0UL)
+#define LCA_IOC_TB_TAG6                (IDENT_ADDR + 0x1880000c0UL)
+#define LCA_IOC_TB_TAG7                (IDENT_ADDR + 0x1880000e0UL)
+
+/*
+ * Memory spaces:
+ */
+#define LCA_IACK_SC            (IDENT_ADDR + 0x1a0000000UL)
+#define LCA_CONF               (IDENT_ADDR + 0x1e0000000UL)
+#define LCA_IO                 (IDENT_ADDR + 0x1c0000000UL)
+#define LCA_SPARSE_MEM         (IDENT_ADDR + 0x200000000UL)
+#define LCA_DENSE_MEM          (IDENT_ADDR + 0x300000000UL)
+
+/*
+ * Bit definitions for I/O Controller status register 0:
+ */
+#define LCA_IOC_STAT0_CMD              0xf
+#define LCA_IOC_STAT0_ERR              (1<<4)
+#define LCA_IOC_STAT0_LOST             (1<<5)
+#define LCA_IOC_STAT0_THIT             (1<<6)
+#define LCA_IOC_STAT0_TREF             (1<<7)
+#define LCA_IOC_STAT0_CODE_SHIFT       8
+#define LCA_IOC_STAT0_CODE_MASK                0x7
+#define LCA_IOC_STAT0_P_NBR_SHIFT      13
+#define LCA_IOC_STAT0_P_NBR_MASK       0x7ffff
+
+#define LCA_HAE_ADDRESS                LCA_IOC_HAE
+
+/* LCA PMR Power Management register defines */
+#define LCA_PMR_ADDR   (IDENT_ADDR + 0x120000098UL)
+#define LCA_PMR_PDIV    0x7                     /* Primary clock divisor */
+#define LCA_PMR_ODIV    0x38                    /* Override clock divisor */
+#define LCA_PMR_INTO    0x40                    /* Interrupt override */
+#define LCA_PMR_DMAO    0x80                    /* DMA override */
+#define LCA_PMR_OCCEB   0xffff0000L             /* Override cycle counter - even bits */
+#define LCA_PMR_OCCOB   0xffff000000000000L     /* Override cycle counter - even bits */
+#define LCA_PMR_PRIMARY_MASK    0xfffffffffffffff8L
+
+/* LCA PMR Macros */
+
+#define LCA_READ_PMR        (*(volatile unsigned long *)LCA_PMR_ADDR)
+#define LCA_WRITE_PMR(d)    (*((volatile unsigned long *)LCA_PMR_ADDR) = (d))
+
+#define LCA_GET_PRIMARY(r)  ((r) & LCA_PMR_PDIV)
+#define LCA_GET_OVERRIDE(r) (((r) >> 3) & LCA_PMR_PDIV)
+#define LCA_SET_PRIMARY_CLOCK(r, c) ((r) = (((r) & LCA_PMR_PRIMARY_MASK)|(c)))
+
+/* LCA PMR Divisor values */
+#define LCA_PMR_DIV_1   0x0
+#define LCA_PMR_DIV_1_5 0x1
+#define LCA_PMR_DIV_2   0x2
+#define LCA_PMR_DIV_4   0x3
+#define LCA_PMR_DIV_8   0x4
+#define LCA_PMR_DIV_16  0x5
+#define LCA_PMR_DIV_MIN DIV_1
+#define LCA_PMR_DIV_MAX DIV_16
+
+
+/*
+ * Data structure for handling LCA machine checks.  Correctable errors
+ * result in a short logout frame, uncorrectable ones in a long one.
+ */
+struct el_lca_mcheck_short {
+       struct el_common        h;              /* common logout header */
+       unsigned long           esr;            /* error-status register */
+       unsigned long           ear;            /* error-address register */
+       unsigned long           dc_stat;        /* dcache status register */
+       unsigned long           ioc_stat0;      /* I/O controller status register 0 */
+       unsigned long           ioc_stat1;      /* I/O controller status register 1 */
+};
+
+struct el_lca_mcheck_long {
+       struct el_common        h;              /* common logout header */
+       unsigned long           pt[31];         /* PAL temps */
+       unsigned long           exc_addr;       /* exception address */
+       unsigned long           pad1[3];
+       unsigned long           pal_base;       /* PALcode base address */
+       unsigned long           hier;           /* hw interrupt enable */
+       unsigned long           hirr;           /* hw interrupt request */
+       unsigned long           mm_csr;         /* MMU control & status */
+       unsigned long           dc_stat;        /* data cache status */
+       unsigned long           dc_addr;        /* data cache addr register */
+       unsigned long           abox_ctl;       /* address box control register */
+       unsigned long           esr;            /* error status register */
+       unsigned long           ear;            /* error address register */
+       unsigned long           car;            /* cache control register */
+       unsigned long           ioc_stat0;      /* I/O controller status register 0 */
+       unsigned long           ioc_stat1;      /* I/O controller status register 1 */
+       unsigned long           va;             /* virtual address register */
+};
+
+union el_lca {
+       struct el_common *              c;
+       struct el_lca_mcheck_long *     l;
+       struct el_lca_mcheck_short *    s;
+};
+
+#ifdef __KERNEL__
+
+#ifndef __EXTERN_INLINE
+#define __EXTERN_INLINE extern inline
+#define __IO_EXTERN_INLINE
+#endif
+
+/*
+ * I/O functions:
+ *
+ * Unlike Jensen, the Noname machines have no concept of local
+ * I/O---everything goes over the PCI bus.
+ *
+ * There is plenty room for optimization here.  In particular,
+ * the Alpha's insb/insw/extb/extw should be useful in moving
+ * data to/from the right byte-lanes.
+ */
+
+#define vip    volatile int __force *
+#define vuip   volatile unsigned int __force *
+#define vulp   volatile unsigned long __force *
+
+#define LCA_SET_HAE                                            \
+       do {                                                    \
+               if (addr >= (1UL << 24)) {                      \
+                       unsigned long msb = addr & 0xf8000000;  \
+                       addr -= msb;                            \
+                       set_hae(msb);                           \
+               }                                               \
+       } while (0)
+
+
+__EXTERN_INLINE unsigned int lca_ioread8(void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       unsigned long result, base_and_type;
+
+       if (addr >= LCA_DENSE_MEM) {
+               addr -= LCA_DENSE_MEM;
+               LCA_SET_HAE;
+               base_and_type = LCA_SPARSE_MEM + 0x00;
+       } else {
+               addr -= LCA_IO;
+               base_and_type = LCA_IO + 0x00;
+       }
+
+       result = *(vip) ((addr << 5) + base_and_type);
+       return __kernel_extbl(result, addr & 3);
+}
+
+__EXTERN_INLINE void lca_iowrite8(u8 b, void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       unsigned long w, base_and_type;
+
+       if (addr >= LCA_DENSE_MEM) {
+               addr -= LCA_DENSE_MEM;
+               LCA_SET_HAE;
+               base_and_type = LCA_SPARSE_MEM + 0x00;
+       } else {
+               addr -= LCA_IO;
+               base_and_type = LCA_IO + 0x00;
+       }
+
+       w = __kernel_insbl(b, addr & 3);
+       *(vuip) ((addr << 5) + base_and_type) = w;
+}
+
+__EXTERN_INLINE unsigned int lca_ioread16(void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       unsigned long result, base_and_type;
+
+       if (addr >= LCA_DENSE_MEM) {
+               addr -= LCA_DENSE_MEM;
+               LCA_SET_HAE;
+               base_and_type = LCA_SPARSE_MEM + 0x08;
+       } else {
+               addr -= LCA_IO;
+               base_and_type = LCA_IO + 0x08;
+       }
+
+       result = *(vip) ((addr << 5) + base_and_type);
+       return __kernel_extwl(result, addr & 3);
+}
+
+__EXTERN_INLINE void lca_iowrite16(u16 b, void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       unsigned long w, base_and_type;
+
+       if (addr >= LCA_DENSE_MEM) {
+               addr -= LCA_DENSE_MEM;
+               LCA_SET_HAE;
+               base_and_type = LCA_SPARSE_MEM + 0x08;
+       } else {
+               addr -= LCA_IO;
+               base_and_type = LCA_IO + 0x08;
+       }
+
+       w = __kernel_inswl(b, addr & 3);
+       *(vuip) ((addr << 5) + base_and_type) = w;
+}
+
+__EXTERN_INLINE unsigned int lca_ioread32(void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       if (addr < LCA_DENSE_MEM)
+               addr = ((addr - LCA_IO) << 5) + LCA_IO + 0x18;
+       return *(vuip)addr;
+}
+
+__EXTERN_INLINE void lca_iowrite32(u32 b, void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       if (addr < LCA_DENSE_MEM)
+               addr = ((addr - LCA_IO) << 5) + LCA_IO + 0x18;
+       *(vuip)addr = b;
+}
+
+__EXTERN_INLINE void __iomem *lca_ioportmap(unsigned long addr)
+{
+       return (void __iomem *)(addr + LCA_IO);
+}
+
+__EXTERN_INLINE void __iomem *lca_ioremap(unsigned long addr,
+                                         unsigned long size)
+{
+       return (void __iomem *)(addr + LCA_DENSE_MEM);
+}
+
+__EXTERN_INLINE int lca_is_ioaddr(unsigned long addr)
+{
+       return addr >= IDENT_ADDR + 0x120000000UL;
+}
+
+__EXTERN_INLINE int lca_is_mmio(const volatile void __iomem *addr)
+{
+       return (unsigned long)addr >= LCA_DENSE_MEM;
+}
+
+#undef vip
+#undef vuip
+#undef vulp
+
+#undef __IO_PREFIX
+#define __IO_PREFIX            lca
+#define lca_trivial_rw_bw      2
+#define lca_trivial_rw_lq      1
+#define lca_trivial_io_bw      0
+#define lca_trivial_io_lq      0
+#define lca_trivial_iounmap    1
+#include <asm/io_trivial.h>
+
+#ifdef __IO_EXTERN_INLINE
+#undef __EXTERN_INLINE
+#undef __IO_EXTERN_INLINE
+#endif
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_LCA__H__ */
diff --git a/arch/alpha/include/asm/core_marvel.h b/arch/alpha/include/asm/core_marvel.h
new file mode 100644 (file)
index 0000000..30d55fe
--- /dev/null
@@ -0,0 +1,378 @@
+/*
+ * Marvel systems use the IO7 I/O chip provides PCI/PCIX/AGP access
+ *
+ * This file is based on:
+ *
+ * Marvel / EV7 System Programmer's Manual
+ * Revision 1.00
+ * 14 May 2001
+ */
+
+#ifndef __ALPHA_MARVEL__H__
+#define __ALPHA_MARVEL__H__
+
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <linux/spinlock.h>
+
+#include <asm/compiler.h>
+
+#define MARVEL_MAX_PIDS                 32 /* as long as we rely on 43-bit superpage */
+#define MARVEL_IRQ_VEC_PE_SHIFT        (10)
+#define MARVEL_IRQ_VEC_IRQ_MASK        ((1 << MARVEL_IRQ_VEC_PE_SHIFT) - 1)
+#define MARVEL_NR_IRQS         \
+       (16 + (MARVEL_MAX_PIDS * (1 << MARVEL_IRQ_VEC_PE_SHIFT)))
+
+/*
+ * EV7 RBOX Registers
+ */
+typedef struct {
+       volatile unsigned long csr __attribute__((aligned(16)));
+} ev7_csr;
+
+typedef struct {
+       ev7_csr RBOX_CFG;               /* 0x0000 */
+       ev7_csr RBOX_NSVC;
+       ev7_csr RBOX_EWVC;
+       ev7_csr RBOX_WHAMI;
+       ev7_csr RBOX_TCTL;              /* 0x0040 */
+       ev7_csr RBOX_INT;
+       ev7_csr RBOX_IMASK;
+       ev7_csr RBOX_IREQ;
+       ev7_csr RBOX_INTQ;              /* 0x0080 */
+       ev7_csr RBOX_INTA;
+       ev7_csr RBOX_IT;
+       ev7_csr RBOX_SCRATCH1;
+       ev7_csr RBOX_SCRATCH2;          /* 0x00c0 */
+       ev7_csr RBOX_L_ERR;
+} ev7_csrs;
+
+/*
+ * EV7 CSR addressing macros
+ */
+#define EV7_MASK40(addr)        ((addr) & ((1UL << 41) - 1))
+#define EV7_KERN_ADDR(addr)    ((void *)(IDENT_ADDR | EV7_MASK40(addr)))
+
+#define EV7_PE_MASK            0x1ffUL /* 9 bits ( 256 + mem/io ) */
+#define EV7_IPE(pe)            ((~((long)(pe)) & EV7_PE_MASK) << 35)
+
+#define EV7_CSR_PHYS(pe, off)  (EV7_IPE(pe) | (0x7FFCUL << 20) | (off))
+#define EV7_CSRS_PHYS(pe)      (EV7_CSR_PHYS(pe, 0UL))
+
+#define EV7_CSR_KERN(pe, off)  (EV7_KERN_ADDR(EV7_CSR_PHYS(pe, off)))
+#define EV7_CSRS_KERN(pe)      (EV7_KERN_ADDR(EV7_CSRS_PHYS(pe)))
+
+#define EV7_CSR_OFFSET(name)   ((unsigned long)&((ev7_csrs *)NULL)->name.csr)
+
+/*
+ * IO7 registers
+ */
+typedef struct {
+       volatile unsigned long csr __attribute__((aligned(64)));
+} io7_csr;
+
+typedef struct {
+       /* I/O Port Control Registers */
+       io7_csr POx_CTRL;               /* 0x0000 */
+       io7_csr POx_CACHE_CTL;
+       io7_csr POx_TIMER;
+       io7_csr POx_IO_ADR_EXT;
+       io7_csr POx_MEM_ADR_EXT;        /* 0x0100 */
+       io7_csr POx_XCAL_CTRL;
+       io7_csr rsvd1[2];       /* ?? spec doesn't show 0x180 */
+       io7_csr POx_DM_SOURCE;          /* 0x0200 */
+       io7_csr POx_DM_DEST;
+       io7_csr POx_DM_SIZE;
+       io7_csr POx_DM_CTRL;
+       io7_csr rsvd2[4];               /* 0x0300 */
+
+       /* AGP Control Registers -- port 3 only */
+       io7_csr AGP_CAP_ID;             /* 0x0400 */
+       io7_csr AGP_STAT;
+       io7_csr AGP_CMD;
+       io7_csr rsvd3;
+
+       /* I/O Port Monitor Registers */
+       io7_csr POx_MONCTL;             /* 0x0500 */
+       io7_csr POx_CTRA;
+       io7_csr POx_CTRB;
+       io7_csr POx_CTR56;
+       io7_csr POx_SCRATCH;            /* 0x0600 */
+       io7_csr POx_XTRA_A;
+       io7_csr POx_XTRA_TS;
+       io7_csr POx_XTRA_Z;
+       io7_csr rsvd4;                  /* 0x0700 */
+       io7_csr POx_THRESHA;
+       io7_csr POx_THRESHB;
+       io7_csr rsvd5[33];
+
+       /* System Address Space Window Control Registers */
+
+       io7_csr POx_WBASE[4];           /* 0x1000 */
+       io7_csr POx_WMASK[4];
+       io7_csr POx_TBASE[4];
+       io7_csr POx_SG_TBIA;
+       io7_csr POx_MSI_WBASE;
+       io7_csr rsvd6[50];
+
+       /* I/O Port Error Registers */
+       io7_csr POx_ERR_SUM;
+       io7_csr POx_FIRST_ERR;
+       io7_csr POx_MSK_HEI;
+       io7_csr POx_TLB_ERR;
+       io7_csr POx_SPL_COMPLT;
+       io7_csr POx_TRANS_SUM;
+       io7_csr POx_FRC_PCI_ERR;
+       io7_csr POx_MULT_ERR;
+       io7_csr rsvd7[8];
+
+       /* I/O Port End of Interrupt Registers */
+       io7_csr EOI_DAT;
+       io7_csr rsvd8[7];
+       io7_csr POx_IACK_SPECIAL;
+       io7_csr rsvd9[103];
+} io7_ioport_csrs;
+
+typedef struct {
+       io7_csr IO_ASIC_REV;            /* 0x30.0000 */
+       io7_csr IO_SYS_REV;
+       io7_csr SER_CHAIN3;
+       io7_csr PO7_RST1;
+       io7_csr PO7_RST2;               /* 0x30.0100 */
+       io7_csr POx_RST[4];
+       io7_csr IO7_DWNH;
+       io7_csr IO7_MAF;
+       io7_csr IO7_MAF_TO;
+       io7_csr IO7_ACC_CLUMP;          /* 0x30.0300 */
+       io7_csr IO7_PMASK;
+       io7_csr IO7_IOMASK;
+       io7_csr IO7_UPH;
+       io7_csr IO7_UPH_TO;             /* 0x30.0400 */
+       io7_csr RBX_IREQ_OFF;
+       io7_csr RBX_INTA_OFF;
+       io7_csr INT_RTY;
+       io7_csr PO7_MONCTL;             /* 0x30.0500 */
+       io7_csr PO7_CTRA;
+       io7_csr PO7_CTRB;
+       io7_csr PO7_CTR56;
+       io7_csr PO7_SCRATCH;            /* 0x30.0600 */
+       io7_csr PO7_XTRA_A;
+       io7_csr PO7_XTRA_TS;
+       io7_csr PO7_XTRA_Z;
+       io7_csr PO7_PMASK;              /* 0x30.0700 */
+       io7_csr PO7_THRESHA;
+       io7_csr PO7_THRESHB;
+       io7_csr rsvd1[97];
+       io7_csr PO7_ERROR_SUM;          /* 0x30.2000 */
+       io7_csr PO7_BHOLE_MASK;
+       io7_csr PO7_HEI_MSK;
+       io7_csr PO7_CRD_MSK;
+       io7_csr PO7_UNCRR_SYM;          /* 0x30.2100 */
+       io7_csr PO7_CRRCT_SYM;
+       io7_csr PO7_ERR_PKT[2];
+       io7_csr PO7_UGBGE_SYM;          /* 0x30.2200 */
+       io7_csr rsbv2[887];
+       io7_csr PO7_LSI_CTL[128];       /* 0x31.0000 */
+       io7_csr rsvd3[123];
+       io7_csr HLT_CTL;                /* 0x31.3ec0 */
+       io7_csr HPI_CTL;                /* 0x31.3f00 */
+       io7_csr CRD_CTL;
+       io7_csr STV_CTL;
+       io7_csr HEI_CTL;
+       io7_csr PO7_MSI_CTL[16];        /* 0x31.4000 */
+       io7_csr rsvd4[240];
+
+       /*
+        * Interrupt Diagnostic / Test
+        */
+       struct {
+               io7_csr INT_PND;
+               io7_csr INT_CLR;
+               io7_csr INT_EOI;
+               io7_csr rsvd[29];
+       } INT_DIAG[4];
+       io7_csr rsvd5[125];             /* 0x31.a000 */
+       io7_csr MISC_PND;               /* 0x31.b800 */
+       io7_csr rsvd6[31];
+       io7_csr MSI_PND[16];            /* 0x31.c000 */
+       io7_csr rsvd7[16];
+       io7_csr MSI_CLR[16];            /* 0x31.c800 */
+} io7_port7_csrs;
+
+/* 
+ * IO7 DMA Window Base register (POx_WBASEx)
+ */
+#define wbase_m_ena  0x1
+#define wbase_m_sg   0x2
+#define wbase_m_dac  0x4
+#define wbase_m_addr 0xFFF00000
+union IO7_POx_WBASE {
+       struct {
+               unsigned ena : 1;       /* <0>                  */
+               unsigned sg : 1;        /* <1>                  */
+               unsigned dac : 1;       /* <2> -- window 3 only */
+               unsigned rsvd1 : 17; 
+               unsigned addr : 12;     /* <31:20>              */
+               unsigned rsvd2 : 32;
+       } bits;
+       unsigned as_long[2];
+       unsigned as_quad;
+};
+
+/*
+ * IO7 IID (Interrupt IDentifier) format
+ *
+ * For level-sensative interrupts, int_num is encoded as:
+ *
+ *     bus/port        slot/device     INTx
+ *     <7:5>           <4:2>           <1:0>
+ */
+union IO7_IID {
+       struct {
+               unsigned int_num : 9;           /* <8:0>        */
+               unsigned tpu_mask : 4;          /* <12:9> rsvd  */
+               unsigned msi : 1;               /* 13           */
+               unsigned ipe : 10;              /* <23:14>      */
+               unsigned long rsvd : 40;                
+       } bits;
+       unsigned int as_long[2];
+       unsigned long as_quad;
+};
+
+/*
+ * IO7 addressing macros
+ */
+#define IO7_KERN_ADDR(addr)    (EV7_KERN_ADDR(addr))
+
+#define IO7_PORT_MASK          0x07UL  /* 3 bits of port          */
+
+#define IO7_IPE(pe)            (EV7_IPE(pe))
+#define IO7_IPORT(port)                ((~((long)(port)) & IO7_PORT_MASK) << 32)
+
+#define IO7_HOSE(pe, port)     (IO7_IPE(pe) | IO7_IPORT(port))
+
+#define IO7_MEM_PHYS(pe, port) (IO7_HOSE(pe, port) | 0x00000000UL)
+#define IO7_CONF_PHYS(pe, port)        (IO7_HOSE(pe, port) | 0xFE000000UL)
+#define IO7_IO_PHYS(pe, port)  (IO7_HOSE(pe, port) | 0xFF000000UL)
+#define IO7_CSR_PHYS(pe, port, off) \
+                                (IO7_HOSE(pe, port) | 0xFF800000UL | (off))
+#define IO7_CSRS_PHYS(pe, port)        (IO7_CSR_PHYS(pe, port, 0UL))
+#define IO7_PORT7_CSRS_PHYS(pe) (IO7_CSR_PHYS(pe, 7, 0x300000UL))
+
+#define IO7_MEM_KERN(pe, port)      (IO7_KERN_ADDR(IO7_MEM_PHYS(pe, port)))
+#define IO7_CONF_KERN(pe, port)     (IO7_KERN_ADDR(IO7_CONF_PHYS(pe, port)))
+#define IO7_IO_KERN(pe, port)       (IO7_KERN_ADDR(IO7_IO_PHYS(pe, port)))
+#define IO7_CSR_KERN(pe, port, off) (IO7_KERN_ADDR(IO7_CSR_PHYS(pe,port,off)))
+#define IO7_CSRS_KERN(pe, port)     (IO7_KERN_ADDR(IO7_CSRS_PHYS(pe, port)))
+#define IO7_PORT7_CSRS_KERN(pe)            (IO7_KERN_ADDR(IO7_PORT7_CSRS_PHYS(pe)))
+
+#define IO7_PLL_RNGA(pll)      (((pll) >> 3) & 0x7)
+#define IO7_PLL_RNGB(pll)      (((pll) >> 6) & 0x7)
+
+#define IO7_MEM_SPACE          (2UL * 1024 * 1024 * 1024)      /* 2GB MEM */
+#define IO7_IO_SPACE           (8UL * 1024 * 1024)             /* 8MB I/O */
+
+/* 
+ * Offset between ram physical addresses and pci64 DAC addresses
+ */
+#define IO7_DAC_OFFSET         (1UL << 49)
+
+/*
+ * This is needed to satisify the IO() macro used in initializing the machvec
+ */
+#define MARVEL_IACK_SC                                                         \
+        ((unsigned long)                                               \
+        (&(((io7_ioport_csrs *)IO7_CSRS_KERN(0, 0))->POx_IACK_SPECIAL)))
+
+#ifdef __KERNEL__
+
+/*
+ * IO7 structs
+ */
+#define IO7_NUM_PORTS 4
+#define IO7_AGP_PORT  3
+
+struct io7_port {
+       struct io7 *io7;
+       struct pci_controller *hose;
+
+       int enabled;
+       unsigned int port;
+       io7_ioport_csrs *csrs;
+
+       unsigned long saved_wbase[4];
+       unsigned long saved_wmask[4];
+       unsigned long saved_tbase[4];
+};
+
+struct io7 {
+       struct io7 *next;
+
+       unsigned int pe;
+       io7_port7_csrs *csrs;
+       struct io7_port ports[IO7_NUM_PORTS];
+
+       spinlock_t irq_lock;
+};
+
+#ifndef __EXTERN_INLINE
+# define __EXTERN_INLINE extern inline
+# define __IO_EXTERN_INLINE
+#endif
+
+/*
+ * I/O functions. All access through linear space.
+ */
+
+/*
+ * Memory functions.  All accesses through linear space.
+ */
+
+#define vucp   volatile unsigned char __force *
+#define vusp   volatile unsigned short __force *
+
+extern unsigned int marvel_ioread8(void __iomem *);
+extern void marvel_iowrite8(u8 b, void __iomem *);
+
+__EXTERN_INLINE unsigned int marvel_ioread16(void __iomem *addr)
+{
+       return __kernel_ldwu(*(vusp)addr);
+}
+
+__EXTERN_INLINE void marvel_iowrite16(u16 b, void __iomem *addr)
+{
+       __kernel_stw(b, *(vusp)addr);
+}
+
+extern void __iomem *marvel_ioremap(unsigned long addr, unsigned long size);
+extern void marvel_iounmap(volatile void __iomem *addr);
+extern void __iomem *marvel_ioportmap (unsigned long addr);
+
+__EXTERN_INLINE int marvel_is_ioaddr(unsigned long addr)
+{
+       return (addr >> 40) & 1;
+}
+
+extern int marvel_is_mmio(const volatile void __iomem *);
+
+#undef vucp
+#undef vusp
+
+#undef __IO_PREFIX
+#define __IO_PREFIX            marvel
+#define marvel_trivial_rw_bw   1
+#define marvel_trivial_rw_lq   1
+#define marvel_trivial_io_bw   0
+#define marvel_trivial_io_lq   1
+#define marvel_trivial_iounmap 0
+#include <asm/io_trivial.h>
+
+#ifdef __IO_EXTERN_INLINE
+# undef __EXTERN_INLINE
+# undef __IO_EXTERN_INLINE
+#endif
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_MARVEL__H__ */
diff --git a/arch/alpha/include/asm/core_mcpcia.h b/arch/alpha/include/asm/core_mcpcia.h
new file mode 100644 (file)
index 0000000..acf55b4
--- /dev/null
@@ -0,0 +1,381 @@
+#ifndef __ALPHA_MCPCIA__H__
+#define __ALPHA_MCPCIA__H__
+
+/* Define to experiment with fitting everything into one 128MB HAE window.
+   One window per bus, that is.  */
+#define MCPCIA_ONE_HAE_WINDOW 1
+
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <asm/compiler.h>
+
+/*
+ * MCPCIA is the internal name for a core logic chipset which provides
+ * PCI access for the RAWHIDE family of systems.
+ *
+ * This file is based on:
+ *
+ * RAWHIDE System Programmer's Manual
+ * 16-May-96
+ * Rev. 1.4
+ *
+ */
+
+/*------------------------------------------------------------------------**
+**                                                                        **
+**  I/O procedures                                                        **
+**                                                                        **
+**      inport[b|w|t|l], outport[b|w|t|l] 8:16:24:32 IO xfers             **
+**     inportbxt: 8 bits only                                            **
+**      inport:    alias of inportw                                       **
+**      outport:   alias of outportw                                      **
+**                                                                        **
+**      inmem[b|w|t|l], outmem[b|w|t|l] 8:16:24:32 ISA memory xfers       **
+**     inmembxt: 8 bits only                                             **
+**      inmem:    alias of inmemw                                         **
+**      outmem:   alias of outmemw                                        **
+**                                                                        **
+**------------------------------------------------------------------------*/
+
+
+/* MCPCIA ADDRESS BIT DEFINITIONS
+ *
+ *  3333 3333 3322 2222 2222 1111 1111 11
+ *  9876 5432 1098 7654 3210 9876 5432 1098 7654 3210
+ *  ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ *  1                                             000
+ *  ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
+ *  |                                             |\|
+ *  |                               Byte Enable --+ |
+ *  |                             Transfer Length --+
+ *  +-- IO space, not cached
+ *
+ *   Byte      Transfer
+ *   Enable    Length    Transfer  Byte    Address
+ *   adr<6:5>  adr<4:3>  Length    Enable  Adder
+ *   ---------------------------------------------
+ *      00        00      Byte      1110   0x000
+ *      01        00      Byte      1101   0x020
+ *      10        00      Byte      1011   0x040
+ *      11        00      Byte      0111   0x060
+ *
+ *      00        01      Word      1100   0x008
+ *      01        01      Word      1001   0x028 <= Not supported in this code.
+ *      10        01      Word      0011   0x048
+ *
+ *      00        10      Tribyte   1000   0x010
+ *      01        10      Tribyte   0001   0x030
+ *
+ *      10        11      Longword  0000   0x058
+ *
+ *      Note that byte enables are asserted low.
+ *
+ */
+
+#define MCPCIA_MAX_HOSES 4
+
+#define MCPCIA_MID(m)          ((unsigned long)(m) << 33)
+
+/* Dodge has PCI0 and PCI1 at MID 4 and 5 respectively. 
+   Durango adds PCI2 and PCI3 at MID 6 and 7 respectively.  */
+#define MCPCIA_HOSE2MID(h)     ((h) + 4)
+
+#define MCPCIA_MEM_MASK 0x07ffffff /* SPARSE Mem region mask is 27 bits */
+
+/*
+ * Memory spaces:
+ */
+#define MCPCIA_SPARSE(m)       (IDENT_ADDR + 0xf000000000UL + MCPCIA_MID(m))
+#define MCPCIA_DENSE(m)                (IDENT_ADDR + 0xf100000000UL + MCPCIA_MID(m))
+#define MCPCIA_IO(m)           (IDENT_ADDR + 0xf180000000UL + MCPCIA_MID(m))
+#define MCPCIA_CONF(m)         (IDENT_ADDR + 0xf1c0000000UL + MCPCIA_MID(m))
+#define MCPCIA_CSR(m)          (IDENT_ADDR + 0xf1e0000000UL + MCPCIA_MID(m))
+#define MCPCIA_IO_IACK(m)      (IDENT_ADDR + 0xf1f0000000UL + MCPCIA_MID(m))
+#define MCPCIA_DENSE_IO(m)     (IDENT_ADDR + 0xe1fc000000UL + MCPCIA_MID(m))
+#define MCPCIA_DENSE_CONF(m)   (IDENT_ADDR + 0xe1fe000000UL + MCPCIA_MID(m))
+
+/*
+ *  General Registers
+ */
+#define MCPCIA_REV(m)          (MCPCIA_CSR(m) + 0x000)
+#define MCPCIA_WHOAMI(m)       (MCPCIA_CSR(m) + 0x040)
+#define MCPCIA_PCI_LAT(m)      (MCPCIA_CSR(m) + 0x080)
+#define MCPCIA_CAP_CTRL(m)     (MCPCIA_CSR(m) + 0x100)
+#define MCPCIA_HAE_MEM(m)      (MCPCIA_CSR(m) + 0x400)
+#define MCPCIA_HAE_IO(m)       (MCPCIA_CSR(m) + 0x440)
+#define _MCPCIA_IACK_SC(m)     (MCPCIA_CSR(m) + 0x480)
+#define MCPCIA_HAE_DENSE(m)    (MCPCIA_CSR(m) + 0x4C0)
+
+/*
+ * Interrupt Control registers
+ */
+#define MCPCIA_INT_CTL(m)      (MCPCIA_CSR(m) + 0x500)
+#define MCPCIA_INT_REQ(m)      (MCPCIA_CSR(m) + 0x540)
+#define MCPCIA_INT_TARG(m)     (MCPCIA_CSR(m) + 0x580)
+#define MCPCIA_INT_ADR(m)      (MCPCIA_CSR(m) + 0x5C0)
+#define MCPCIA_INT_ADR_EXT(m)  (MCPCIA_CSR(m) + 0x600)
+#define MCPCIA_INT_MASK0(m)    (MCPCIA_CSR(m) + 0x640)
+#define MCPCIA_INT_MASK1(m)    (MCPCIA_CSR(m) + 0x680)
+#define MCPCIA_INT_ACK0(m)     (MCPCIA_CSR(m) + 0x10003f00)
+#define MCPCIA_INT_ACK1(m)     (MCPCIA_CSR(m) + 0x10003f40)
+
+/*
+ * Performance Monitor registers
+ */
+#define MCPCIA_PERF_MON(m)     (MCPCIA_CSR(m) + 0x300)
+#define MCPCIA_PERF_CONT(m)    (MCPCIA_CSR(m) + 0x340)
+
+/*
+ * Diagnostic Registers
+ */
+#define MCPCIA_CAP_DIAG(m)     (MCPCIA_CSR(m) + 0x700)
+#define MCPCIA_TOP_OF_MEM(m)   (MCPCIA_CSR(m) + 0x7C0)
+
+/*
+ * Error registers
+ */
+#define MCPCIA_MC_ERR0(m)      (MCPCIA_CSR(m) + 0x800)
+#define MCPCIA_MC_ERR1(m)      (MCPCIA_CSR(m) + 0x840)
+#define MCPCIA_CAP_ERR(m)      (MCPCIA_CSR(m) + 0x880)
+#define MCPCIA_PCI_ERR1(m)     (MCPCIA_CSR(m) + 0x1040)
+#define MCPCIA_MDPA_STAT(m)    (MCPCIA_CSR(m) + 0x4000)
+#define MCPCIA_MDPA_SYN(m)     (MCPCIA_CSR(m) + 0x4040)
+#define MCPCIA_MDPA_DIAG(m)    (MCPCIA_CSR(m) + 0x4080)
+#define MCPCIA_MDPB_STAT(m)    (MCPCIA_CSR(m) + 0x8000)
+#define MCPCIA_MDPB_SYN(m)     (MCPCIA_CSR(m) + 0x8040)
+#define MCPCIA_MDPB_DIAG(m)    (MCPCIA_CSR(m) + 0x8080)
+
+/*
+ * PCI Address Translation Registers.
+ */
+#define MCPCIA_SG_TBIA(m)      (MCPCIA_CSR(m) + 0x1300)
+#define MCPCIA_HBASE(m)                (MCPCIA_CSR(m) + 0x1340)
+
+#define MCPCIA_W0_BASE(m)      (MCPCIA_CSR(m) + 0x1400)
+#define MCPCIA_W0_MASK(m)      (MCPCIA_CSR(m) + 0x1440)
+#define MCPCIA_T0_BASE(m)      (MCPCIA_CSR(m) + 0x1480)
+
+#define MCPCIA_W1_BASE(m)      (MCPCIA_CSR(m) + 0x1500)
+#define MCPCIA_W1_MASK(m)      (MCPCIA_CSR(m) + 0x1540)
+#define MCPCIA_T1_BASE(m)      (MCPCIA_CSR(m) + 0x1580)
+
+#define MCPCIA_W2_BASE(m)      (MCPCIA_CSR(m) + 0x1600)
+#define MCPCIA_W2_MASK(m)      (MCPCIA_CSR(m) + 0x1640)
+#define MCPCIA_T2_BASE(m)      (MCPCIA_CSR(m) + 0x1680)
+
+#define MCPCIA_W3_BASE(m)      (MCPCIA_CSR(m) + 0x1700)
+#define MCPCIA_W3_MASK(m)      (MCPCIA_CSR(m) + 0x1740)
+#define MCPCIA_T3_BASE(m)      (MCPCIA_CSR(m) + 0x1780)
+
+/* Hack!  Only words for bus 0.  */
+
+#ifndef MCPCIA_ONE_HAE_WINDOW
+#define MCPCIA_HAE_ADDRESS     MCPCIA_HAE_MEM(4)
+#endif
+#define MCPCIA_IACK_SC         _MCPCIA_IACK_SC(4)
+
+/* 
+ * The canonical non-remaped I/O and MEM addresses have these values
+ * subtracted out.  This is arranged so that folks manipulating ISA
+ * devices can use their familiar numbers and have them map to bus 0.
+ */
+
+#define MCPCIA_IO_BIAS         MCPCIA_IO(4)
+#define MCPCIA_MEM_BIAS                MCPCIA_DENSE(4)
+
+/* Offset between ram physical addresses and pci64 DAC bus addresses.  */
+#define MCPCIA_DAC_OFFSET      (1UL << 40)
+
+/*
+ * Data structure for handling MCPCIA machine checks:
+ */
+struct el_MCPCIA_uncorrected_frame_mcheck {
+       struct el_common header;
+       struct el_common_EV5_uncorrectable_mcheck procdata;
+};
+
+
+#ifdef __KERNEL__
+
+#ifndef __EXTERN_INLINE
+#define __EXTERN_INLINE extern inline
+#define __IO_EXTERN_INLINE
+#endif
+
+/*
+ * I/O functions:
+ *
+ * MCPCIA, the RAWHIDE family PCI/memory support chipset for the EV5 (21164)
+ * and EV56 (21164a) processors, can use either a sparse address mapping
+ * scheme, or the so-called byte-word PCI address space, to get at PCI memory
+ * and I/O.
+ *
+ * Unfortunately, we can't use BWIO with EV5, so for now, we always use SPARSE.
+ */
+
+/*
+ * Memory functions.  64-bit and 32-bit accesses are done through
+ * dense memory space, everything else through sparse space.
+ *
+ * For reading and writing 8 and 16 bit quantities we need to
+ * go through one of the three sparse address mapping regions
+ * and use the HAE_MEM CSR to provide some bits of the address.
+ * The following few routines use only sparse address region 1
+ * which gives 1Gbyte of accessible space which relates exactly
+ * to the amount of PCI memory mapping *into* system address space.
+ * See p 6-17 of the specification but it looks something like this:
+ *
+ * 21164 Address:
+ *
+ *          3         2         1
+ * 9876543210987654321098765432109876543210
+ * 1ZZZZ0.PCI.QW.Address............BBLL
+ *
+ * ZZ = SBZ
+ * BB = Byte offset
+ * LL = Transfer length
+ *
+ * PCI Address:
+ *
+ * 3         2         1
+ * 10987654321098765432109876543210
+ * HHH....PCI.QW.Address........ 00
+ *
+ * HHH = 31:29 HAE_MEM CSR
+ *
+ */
+
+#define vip    volatile int __force *
+#define vuip   volatile unsigned int __force *
+
+#ifdef MCPCIA_ONE_HAE_WINDOW
+#define MCPCIA_FROB_MMIO                                               \
+       if (__mcpcia_is_mmio(hose)) {                                   \
+               set_hae(hose & 0xffffffff);                             \
+               hose = hose - MCPCIA_DENSE(4) + MCPCIA_SPARSE(4);       \
+       }
+#else
+#define MCPCIA_FROB_MMIO                                               \
+       if (__mcpcia_is_mmio(hose)) {                                   \
+               hose = hose - MCPCIA_DENSE(4) + MCPCIA_SPARSE(4);       \
+       }
+#endif
+
+extern inline int __mcpcia_is_mmio(unsigned long addr)
+{
+       return (addr & 0x80000000UL) == 0;
+}
+
+__EXTERN_INLINE unsigned int mcpcia_ioread8(void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long)xaddr & MCPCIA_MEM_MASK;
+       unsigned long hose = (unsigned long)xaddr & ~MCPCIA_MEM_MASK;
+       unsigned long result;
+
+       MCPCIA_FROB_MMIO;
+
+       result = *(vip) ((addr << 5) + hose + 0x00);
+       return __kernel_extbl(result, addr & 3);
+}
+
+__EXTERN_INLINE void mcpcia_iowrite8(u8 b, void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long)xaddr & MCPCIA_MEM_MASK;
+       unsigned long hose = (unsigned long)xaddr & ~MCPCIA_MEM_MASK;
+       unsigned long w;
+
+       MCPCIA_FROB_MMIO;
+
+       w = __kernel_insbl(b, addr & 3);
+       *(vuip) ((addr << 5) + hose + 0x00) = w;
+}
+
+__EXTERN_INLINE unsigned int mcpcia_ioread16(void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long)xaddr & MCPCIA_MEM_MASK;
+       unsigned long hose = (unsigned long)xaddr & ~MCPCIA_MEM_MASK;
+       unsigned long result;
+
+       MCPCIA_FROB_MMIO;
+
+       result = *(vip) ((addr << 5) + hose + 0x08);
+       return __kernel_extwl(result, addr & 3);
+}
+
+__EXTERN_INLINE void mcpcia_iowrite16(u16 b, void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long)xaddr & MCPCIA_MEM_MASK;
+       unsigned long hose = (unsigned long)xaddr & ~MCPCIA_MEM_MASK;
+       unsigned long w;
+
+       MCPCIA_FROB_MMIO;
+
+       w = __kernel_inswl(b, addr & 3);
+       *(vuip) ((addr << 5) + hose + 0x08) = w;
+}
+
+__EXTERN_INLINE unsigned int mcpcia_ioread32(void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long)xaddr;
+
+       if (!__mcpcia_is_mmio(addr))
+               addr = ((addr & 0xffff) << 5) + (addr & ~0xfffful) + 0x18;
+
+       return *(vuip)addr;
+}
+
+__EXTERN_INLINE void mcpcia_iowrite32(u32 b, void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long)xaddr;
+
+       if (!__mcpcia_is_mmio(addr))
+               addr = ((addr & 0xffff) << 5) + (addr & ~0xfffful) + 0x18;
+
+       *(vuip)addr = b;
+}
+
+
+__EXTERN_INLINE void __iomem *mcpcia_ioportmap(unsigned long addr)
+{
+       return (void __iomem *)(addr + MCPCIA_IO_BIAS);
+}
+
+__EXTERN_INLINE void __iomem *mcpcia_ioremap(unsigned long addr,
+                                            unsigned long size)
+{
+       return (void __iomem *)(addr + MCPCIA_MEM_BIAS);
+}
+
+__EXTERN_INLINE int mcpcia_is_ioaddr(unsigned long addr)
+{
+       return addr >= MCPCIA_SPARSE(0);
+}
+
+__EXTERN_INLINE int mcpcia_is_mmio(const volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       return __mcpcia_is_mmio(addr);
+}
+
+#undef MCPCIA_FROB_MMIO
+
+#undef vip
+#undef vuip
+
+#undef __IO_PREFIX
+#define __IO_PREFIX            mcpcia
+#define mcpcia_trivial_rw_bw   2
+#define mcpcia_trivial_rw_lq   1
+#define mcpcia_trivial_io_bw   0
+#define mcpcia_trivial_io_lq   0
+#define mcpcia_trivial_iounmap 1
+#include <asm/io_trivial.h>
+
+#ifdef __IO_EXTERN_INLINE
+#undef __EXTERN_INLINE
+#undef __IO_EXTERN_INLINE
+#endif
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_MCPCIA__H__ */
diff --git a/arch/alpha/include/asm/core_polaris.h b/arch/alpha/include/asm/core_polaris.h
new file mode 100644 (file)
index 0000000..2f966b6
--- /dev/null
@@ -0,0 +1,110 @@
+#ifndef __ALPHA_POLARIS__H__
+#define __ALPHA_POLARIS__H__
+
+#include <linux/types.h>
+#include <asm/compiler.h>
+
+/*
+ * POLARIS is the internal name for a core logic chipset which provides
+ * memory controller and PCI access for the 21164PC chip based systems.
+ *
+ * This file is based on:
+ *
+ * Polaris System Controller
+ * Device Functional Specification
+ * 22-Jan-98
+ * Rev. 4.2
+ *
+ */
+
+/* Polaris memory regions */
+#define POLARIS_SPARSE_MEM_BASE                (IDENT_ADDR + 0xf800000000UL)
+#define POLARIS_DENSE_MEM_BASE         (IDENT_ADDR + 0xf900000000UL)
+#define POLARIS_SPARSE_IO_BASE         (IDENT_ADDR + 0xf980000000UL)
+#define POLARIS_SPARSE_CONFIG_BASE     (IDENT_ADDR + 0xf9c0000000UL)
+#define POLARIS_IACK_BASE              (IDENT_ADDR + 0xf9f8000000UL)
+#define POLARIS_DENSE_IO_BASE          (IDENT_ADDR + 0xf9fc000000UL)
+#define POLARIS_DENSE_CONFIG_BASE      (IDENT_ADDR + 0xf9fe000000UL)
+
+#define POLARIS_IACK_SC                        POLARIS_IACK_BASE
+
+/* The Polaris command/status registers live in PCI Config space for
+ * bus 0/device 0.  As such, they may be bytes, words, or doublewords.
+ */
+#define POLARIS_W_VENID                (POLARIS_DENSE_CONFIG_BASE)
+#define POLARIS_W_DEVID                (POLARIS_DENSE_CONFIG_BASE+2)
+#define POLARIS_W_CMD          (POLARIS_DENSE_CONFIG_BASE+4)
+#define POLARIS_W_STATUS       (POLARIS_DENSE_CONFIG_BASE+6)
+
+/*
+ * Data structure for handling POLARIS machine checks:
+ */
+struct el_POLARIS_sysdata_mcheck {
+    u_long      psc_status;
+    u_long     psc_pcictl0;
+    u_long     psc_pcictl1;
+    u_long     psc_pcictl2;
+};
+
+#ifdef __KERNEL__
+
+#ifndef __EXTERN_INLINE
+#define __EXTERN_INLINE extern inline
+#define __IO_EXTERN_INLINE
+#endif
+
+/*
+ * I/O functions:
+ *
+ * POLARIS, the PCI/memory support chipset for the PCA56 (21164PC)
+ * processors, can use either a sparse address  mapping scheme, or the 
+ * so-called byte-word PCI address space, to get at PCI memory and I/O.
+ *
+ * However, we will support only the BWX form.
+ */
+
+/*
+ * Memory functions.  Polaris allows all accesses (byte/word
+ * as well as long/quad) to be done through dense space.
+ *
+ * We will only support DENSE access via BWX insns.
+ */
+
+__EXTERN_INLINE void __iomem *polaris_ioportmap(unsigned long addr)
+{
+       return (void __iomem *)(addr + POLARIS_DENSE_IO_BASE);
+}
+
+__EXTERN_INLINE void __iomem *polaris_ioremap(unsigned long addr,
+                                             unsigned long size)
+{
+       return (void __iomem *)(addr + POLARIS_DENSE_MEM_BASE);
+}
+
+__EXTERN_INLINE int polaris_is_ioaddr(unsigned long addr)
+{
+       return addr >= POLARIS_SPARSE_MEM_BASE;
+}
+
+__EXTERN_INLINE int polaris_is_mmio(const volatile void __iomem *addr)
+{
+       return (unsigned long)addr < POLARIS_SPARSE_IO_BASE;
+}
+
+#undef __IO_PREFIX
+#define __IO_PREFIX            polaris
+#define polaris_trivial_rw_bw  1
+#define polaris_trivial_rw_lq  1
+#define polaris_trivial_io_bw  1
+#define polaris_trivial_io_lq  1
+#define polaris_trivial_iounmap        1
+#include <asm/io_trivial.h>
+
+#ifdef __IO_EXTERN_INLINE
+#undef __EXTERN_INLINE
+#undef __IO_EXTERN_INLINE
+#endif
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_POLARIS__H__ */
diff --git a/arch/alpha/include/asm/core_t2.h b/arch/alpha/include/asm/core_t2.h
new file mode 100644 (file)
index 0000000..46bfff5
--- /dev/null
@@ -0,0 +1,633 @@
+#ifndef __ALPHA_T2__H__
+#define __ALPHA_T2__H__
+
+#include <linux/types.h>
+#include <linux/spinlock.h>
+#include <asm/compiler.h>
+#include <asm/system.h>
+
+/*
+ * T2 is the internal name for the core logic chipset which provides
+ * memory controller and PCI access for the SABLE-based systems.
+ *
+ * This file is based on:
+ *
+ * SABLE I/O Specification
+ * Revision/Update Information: 1.3
+ *
+ * jestabro@amt.tay1.dec.com Initial Version.
+ *
+ */
+
+#define T2_MEM_R1_MASK 0x07ffffff  /* Mem sparse region 1 mask is 26 bits */
+
+/* GAMMA-SABLE is a SABLE with EV5-based CPUs */
+/* All LYNX machines, EV4 or EV5, use the GAMMA bias also */
+#define _GAMMA_BIAS            0x8000000000UL
+
+#if defined(CONFIG_ALPHA_GENERIC)
+#define GAMMA_BIAS             alpha_mv.sys.t2.gamma_bias
+#elif defined(CONFIG_ALPHA_GAMMA)
+#define GAMMA_BIAS             _GAMMA_BIAS
+#else
+#define GAMMA_BIAS             0
+#endif
+
+/*
+ * Memory spaces:
+ */
+#define T2_CONF                        (IDENT_ADDR + GAMMA_BIAS + 0x390000000UL)
+#define T2_IO                  (IDENT_ADDR + GAMMA_BIAS + 0x3a0000000UL)
+#define T2_SPARSE_MEM          (IDENT_ADDR + GAMMA_BIAS + 0x200000000UL)
+#define T2_DENSE_MEM           (IDENT_ADDR + GAMMA_BIAS + 0x3c0000000UL)
+
+#define T2_IOCSR               (IDENT_ADDR + GAMMA_BIAS + 0x38e000000UL)
+#define T2_CERR1               (IDENT_ADDR + GAMMA_BIAS + 0x38e000020UL)
+#define T2_CERR2               (IDENT_ADDR + GAMMA_BIAS + 0x38e000040UL)
+#define T2_CERR3               (IDENT_ADDR + GAMMA_BIAS + 0x38e000060UL)
+#define T2_PERR1               (IDENT_ADDR + GAMMA_BIAS + 0x38e000080UL)
+#define T2_PERR2               (IDENT_ADDR + GAMMA_BIAS + 0x38e0000a0UL)
+#define T2_PSCR                        (IDENT_ADDR + GAMMA_BIAS + 0x38e0000c0UL)
+#define T2_HAE_1               (IDENT_ADDR + GAMMA_BIAS + 0x38e0000e0UL)
+#define T2_HAE_2               (IDENT_ADDR + GAMMA_BIAS + 0x38e000100UL)
+#define T2_HBASE               (IDENT_ADDR + GAMMA_BIAS + 0x38e000120UL)
+#define T2_WBASE1              (IDENT_ADDR + GAMMA_BIAS + 0x38e000140UL)
+#define T2_WMASK1              (IDENT_ADDR + GAMMA_BIAS + 0x38e000160UL)
+#define T2_TBASE1              (IDENT_ADDR + GAMMA_BIAS + 0x38e000180UL)
+#define T2_WBASE2              (IDENT_ADDR + GAMMA_BIAS + 0x38e0001a0UL)
+#define T2_WMASK2              (IDENT_ADDR + GAMMA_BIAS + 0x38e0001c0UL)
+#define T2_TBASE2              (IDENT_ADDR + GAMMA_BIAS + 0x38e0001e0UL)
+#define T2_TLBBR               (IDENT_ADDR + GAMMA_BIAS + 0x38e000200UL)
+#define T2_IVR                 (IDENT_ADDR + GAMMA_BIAS + 0x38e000220UL)
+#define T2_HAE_3               (IDENT_ADDR + GAMMA_BIAS + 0x38e000240UL)
+#define T2_HAE_4               (IDENT_ADDR + GAMMA_BIAS + 0x38e000260UL)
+
+/* The CSRs below are T3/T4 only */
+#define T2_WBASE3              (IDENT_ADDR + GAMMA_BIAS + 0x38e000280UL)
+#define T2_WMASK3              (IDENT_ADDR + GAMMA_BIAS + 0x38e0002a0UL)
+#define T2_TBASE3              (IDENT_ADDR + GAMMA_BIAS + 0x38e0002c0UL)
+
+#define T2_TDR0                        (IDENT_ADDR + GAMMA_BIAS + 0x38e000300UL)
+#define T2_TDR1                        (IDENT_ADDR + GAMMA_BIAS + 0x38e000320UL)
+#define T2_TDR2                        (IDENT_ADDR + GAMMA_BIAS + 0x38e000340UL)
+#define T2_TDR3                        (IDENT_ADDR + GAMMA_BIAS + 0x38e000360UL)
+#define T2_TDR4                        (IDENT_ADDR + GAMMA_BIAS + 0x38e000380UL)
+#define T2_TDR5                        (IDENT_ADDR + GAMMA_BIAS + 0x38e0003a0UL)
+#define T2_TDR6                        (IDENT_ADDR + GAMMA_BIAS + 0x38e0003c0UL)
+#define T2_TDR7                        (IDENT_ADDR + GAMMA_BIAS + 0x38e0003e0UL)
+
+#define T2_WBASE4              (IDENT_ADDR + GAMMA_BIAS + 0x38e000400UL)
+#define T2_WMASK4              (IDENT_ADDR + GAMMA_BIAS + 0x38e000420UL)
+#define T2_TBASE4              (IDENT_ADDR + GAMMA_BIAS + 0x38e000440UL)
+
+#define T2_AIR                 (IDENT_ADDR + GAMMA_BIAS + 0x38e000460UL)
+#define T2_VAR                 (IDENT_ADDR + GAMMA_BIAS + 0x38e000480UL)
+#define T2_DIR                 (IDENT_ADDR + GAMMA_BIAS + 0x38e0004a0UL)
+#define T2_ICE                 (IDENT_ADDR + GAMMA_BIAS + 0x38e0004c0UL)
+
+#define T2_HAE_ADDRESS         T2_HAE_1
+
+/*  T2 CSRs are in the non-cachable primary IO space from 3.8000.0000 to
+ 3.8fff.ffff
+ *
+ *  +--------------+ 3 8000 0000
+ *  | CPU 0 CSRs   |
+ *  +--------------+ 3 8100 0000
+ *  | CPU 1 CSRs   |
+ *  +--------------+ 3 8200 0000
+ *  | CPU 2 CSRs   |
+ *  +--------------+ 3 8300 0000
+ *  | CPU 3 CSRs   |
+ *  +--------------+ 3 8400 0000
+ *  | CPU Reserved |
+ *  +--------------+ 3 8700 0000
+ *  | Mem Reserved |
+ *  +--------------+ 3 8800 0000
+ *  | Mem 0 CSRs   |
+ *  +--------------+ 3 8900 0000
+ *  | Mem 1 CSRs   |
+ *  +--------------+ 3 8a00 0000
+ *  | Mem 2 CSRs   |
+ *  +--------------+ 3 8b00 0000
+ *  | Mem 3 CSRs   |
+ *  +--------------+ 3 8c00 0000
+ *  | Mem Reserved |
+ *  +--------------+ 3 8e00 0000
+ *  | PCI Bridge   |
+ *  +--------------+ 3 8f00 0000
+ *  | Expansion IO |
+ *  +--------------+ 3 9000 0000
+ *
+ *
+ */
+#define T2_CPU0_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x380000000L)
+#define T2_CPU1_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x381000000L)
+#define T2_CPU2_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x382000000L)
+#define T2_CPU3_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x383000000L)
+
+#define T2_CPUn_BASE(n)                (T2_CPU0_BASE + (((n)&3) * 0x001000000L))
+
+#define T2_MEM0_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x388000000L)
+#define T2_MEM1_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x389000000L)
+#define T2_MEM2_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x38a000000L)
+#define T2_MEM3_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x38b000000L)
+
+
+/*
+ * Sable CPU Module CSRS
+ *
+ * These are CSRs for hardware other than the CPU chip on the CPU module.
+ * The CPU module has Backup Cache control logic, Cbus control logic, and
+ * interrupt control logic on it.  There is a duplicate tag store to speed
+ * up maintaining cache coherency.
+ */
+
+struct sable_cpu_csr {
+  unsigned long bcc;     long fill_00[3]; /* Backup Cache Control */
+  unsigned long bcce;    long fill_01[3]; /* Backup Cache Correctable Error */
+  unsigned long bccea;   long fill_02[3]; /* B-Cache Corr Err Address Latch */
+  unsigned long bcue;    long fill_03[3]; /* B-Cache Uncorrectable Error */
+  unsigned long bcuea;   long fill_04[3]; /* B-Cache Uncorr Err Addr Latch */
+  unsigned long dter;    long fill_05[3]; /* Duplicate Tag Error */
+  unsigned long cbctl;   long fill_06[3]; /* CBus Control */
+  unsigned long cbe;     long fill_07[3]; /* CBus Error */
+  unsigned long cbeal;   long fill_08[3]; /* CBus Error Addr Latch low */
+  unsigned long cbeah;   long fill_09[3]; /* CBus Error Addr Latch high */
+  unsigned long pmbx;    long fill_10[3]; /* Processor Mailbox */
+  unsigned long ipir;    long fill_11[3]; /* Inter-Processor Int Request */
+  unsigned long sic;     long fill_12[3]; /* System Interrupt Clear */
+  unsigned long adlk;    long fill_13[3]; /* Address Lock (LDxL/STxC) */
+  unsigned long madrl;   long fill_14[3]; /* CBus Miss Address */
+  unsigned long rev;     long fill_15[3]; /* CMIC Revision */
+};
+
+/*
+ * Data structure for handling T2 machine checks:
+ */
+struct el_t2_frame_header {
+       unsigned int    elcf_fid;       /* Frame ID (from above) */
+       unsigned int    elcf_size;      /* Size of frame in bytes */
+};
+
+struct el_t2_procdata_mcheck {
+       unsigned long   elfmc_paltemp[32];      /* PAL TEMP REGS. */
+       /* EV4-specific fields */
+       unsigned long   elfmc_exc_addr; /* Addr of excepting insn. */
+       unsigned long   elfmc_exc_sum;  /* Summary of arith traps. */
+       unsigned long   elfmc_exc_mask; /* Exception mask (from exc_sum). */
+       unsigned long   elfmc_iccsr;    /* IBox hardware enables. */
+       unsigned long   elfmc_pal_base; /* Base address for PALcode. */
+       unsigned long   elfmc_hier;     /* Hardware Interrupt Enable. */
+       unsigned long   elfmc_hirr;     /* Hardware Interrupt Request. */
+       unsigned long   elfmc_mm_csr;   /* D-stream fault info. */
+       unsigned long   elfmc_dc_stat;  /* D-cache status (ECC/Parity Err). */
+       unsigned long   elfmc_dc_addr;  /* EV3 Phys Addr for ECC/DPERR. */
+       unsigned long   elfmc_abox_ctl; /* ABox Control Register. */
+       unsigned long   elfmc_biu_stat; /* BIU Status. */
+       unsigned long   elfmc_biu_addr; /* BUI Address. */
+       unsigned long   elfmc_biu_ctl;  /* BIU Control. */
+       unsigned long   elfmc_fill_syndrome; /* For correcting ECC errors. */
+       unsigned long   elfmc_fill_addr;/* Cache block which was being read. */
+       unsigned long   elfmc_va;       /* Effective VA of fault or miss. */
+       unsigned long   elfmc_bc_tag;   /* Backup Cache Tag Probe Results. */
+};
+
+/*
+ * Sable processor specific Machine Check Data segment.
+ */
+
+struct el_t2_logout_header {
+       unsigned int    elfl_size;      /* size in bytes of logout area. */
+       unsigned int    elfl_sbz1:31;   /* Should be zero. */
+       unsigned int    elfl_retry:1;   /* Retry flag. */
+       unsigned int    elfl_procoffset; /* Processor-specific offset. */
+       unsigned int    elfl_sysoffset;  /* Offset of system-specific. */
+       unsigned int    elfl_error_type;        /* PAL error type code. */
+       unsigned int    elfl_frame_rev;         /* PAL Frame revision. */
+};
+struct el_t2_sysdata_mcheck {
+       unsigned long    elcmc_bcc;           /* CSR 0 */
+       unsigned long    elcmc_bcce;          /* CSR 1 */
+       unsigned long    elcmc_bccea;      /* CSR 2 */
+       unsigned long    elcmc_bcue;          /* CSR 3 */
+       unsigned long    elcmc_bcuea;      /* CSR 4 */
+       unsigned long    elcmc_dter;          /* CSR 5 */
+       unsigned long    elcmc_cbctl;      /* CSR 6 */
+       unsigned long    elcmc_cbe;           /* CSR 7 */
+       unsigned long    elcmc_cbeal;      /* CSR 8 */
+       unsigned long    elcmc_cbeah;      /* CSR 9 */
+       unsigned long    elcmc_pmbx;          /* CSR 10 */
+       unsigned long    elcmc_ipir;          /* CSR 11 */
+       unsigned long    elcmc_sic;           /* CSR 12 */
+       unsigned long    elcmc_adlk;          /* CSR 13 */
+       unsigned long    elcmc_madrl;      /* CSR 14 */
+       unsigned long    elcmc_crrev4;     /* CSR 15 */
+};
+
+/*
+ * Sable memory error frame - sable pfms section 3.42
+ */
+struct el_t2_data_memory {
+       struct  el_t2_frame_header elcm_hdr;    /* ID$MEM-FERR = 0x08 */
+       unsigned int  elcm_module;      /* Module id. */
+       unsigned int  elcm_res04;       /* Reserved. */
+       unsigned long elcm_merr;        /* CSR0: Error Reg 1. */
+       unsigned long elcm_mcmd1;       /* CSR1: Command Trap 1. */
+       unsigned long elcm_mcmd2;       /* CSR2: Command Trap 2. */
+       unsigned long elcm_mconf;       /* CSR3: Configuration. */
+       unsigned long elcm_medc1;       /* CSR4: EDC Status 1. */
+       unsigned long elcm_medc2;       /* CSR5: EDC Status 2. */
+       unsigned long elcm_medcc;       /* CSR6: EDC Control. */
+       unsigned long elcm_msctl;       /* CSR7: Stream Buffer Control. */
+       unsigned long elcm_mref;        /* CSR8: Refresh Control. */
+       unsigned long elcm_filter;      /* CSR9: CRD Filter Control. */
+};
+
+
+/*
+ * Sable other CPU error frame - sable pfms section 3.43
+ */
+struct el_t2_data_other_cpu {
+       short         elco_cpuid;       /* CPU ID */
+       short         elco_res02[3];
+       unsigned long elco_bcc; /* CSR 0 */
+       unsigned long elco_bcce;        /* CSR 1 */
+       unsigned long elco_bccea;       /* CSR 2 */
+       unsigned long elco_bcue;        /* CSR 3 */
+       unsigned long elco_bcuea;       /* CSR 4 */
+       unsigned long elco_dter;        /* CSR 5 */
+       unsigned long elco_cbctl;       /* CSR 6 */
+       unsigned long elco_cbe; /* CSR 7 */
+       unsigned long elco_cbeal;       /* CSR 8 */
+       unsigned long elco_cbeah;       /* CSR 9 */
+       unsigned long elco_pmbx;        /* CSR 10 */
+       unsigned long elco_ipir;        /* CSR 11 */
+       unsigned long elco_sic; /* CSR 12 */
+       unsigned long elco_adlk;        /* CSR 13 */
+       unsigned long elco_madrl;       /* CSR 14 */
+       unsigned long elco_crrev4;      /* CSR 15 */
+};
+
+/*
+ * Sable other CPU error frame - sable pfms section 3.44
+ */
+struct el_t2_data_t2{
+       struct el_t2_frame_header elct_hdr;     /* ID$T2-FRAME */
+       unsigned long elct_iocsr;       /* IO Control and Status Register */
+       unsigned long elct_cerr1;       /* Cbus Error Register 1 */
+       unsigned long elct_cerr2;       /* Cbus Error Register 2 */
+       unsigned long elct_cerr3;       /* Cbus Error Register 3 */
+       unsigned long elct_perr1;       /* PCI Error Register 1 */
+       unsigned long elct_perr2;       /* PCI Error Register 2 */
+       unsigned long elct_hae0_1;      /* High Address Extension Register 1 */
+       unsigned long elct_hae0_2;      /* High Address Extension Register 2 */
+       unsigned long elct_hbase;       /* High Base Register */
+       unsigned long elct_wbase1;      /* Window Base Register 1 */
+       unsigned long elct_wmask1;      /* Window Mask Register 1 */
+       unsigned long elct_tbase1;      /* Translated Base Register 1 */
+       unsigned long elct_wbase2;      /* Window Base Register 2 */
+       unsigned long elct_wmask2;      /* Window Mask Register 2 */
+       unsigned long elct_tbase2;      /* Translated Base Register 2 */
+       unsigned long elct_tdr0;        /* TLB Data Register 0 */
+       unsigned long elct_tdr1;        /* TLB Data Register 1 */
+       unsigned long elct_tdr2;        /* TLB Data Register 2 */
+       unsigned long elct_tdr3;        /* TLB Data Register 3 */
+       unsigned long elct_tdr4;        /* TLB Data Register 4 */
+       unsigned long elct_tdr5;        /* TLB Data Register 5 */
+       unsigned long elct_tdr6;        /* TLB Data Register 6 */
+       unsigned long elct_tdr7;        /* TLB Data Register 7 */
+};
+
+/*
+ * Sable error log data structure - sable pfms section 3.40
+ */
+struct el_t2_data_corrected {
+       unsigned long elcpb_biu_stat;
+       unsigned long elcpb_biu_addr;
+       unsigned long elcpb_biu_ctl;
+       unsigned long elcpb_fill_syndrome;
+       unsigned long elcpb_fill_addr;
+       unsigned long elcpb_bc_tag;
+};
+
+/*
+ * Sable error log data structure
+ * Note there are 4 memory slots on sable (see t2.h)
+ */
+struct el_t2_frame_mcheck {
+       struct el_t2_frame_header elfmc_header; /* ID$P-FRAME_MCHECK */
+       struct el_t2_logout_header elfmc_hdr;
+       struct el_t2_procdata_mcheck elfmc_procdata;
+       struct el_t2_sysdata_mcheck elfmc_sysdata;
+       struct el_t2_data_t2 elfmc_t2data;
+       struct el_t2_data_memory elfmc_memdata[4];
+       struct el_t2_frame_header elfmc_footer; /* empty */
+};
+
+
+/*
+ * Sable error log data structures on memory errors
+ */
+struct el_t2_frame_corrected {
+       struct el_t2_frame_header elfcc_header; /* ID$P-BC-COR */
+       struct el_t2_logout_header elfcc_hdr;
+       struct el_t2_data_corrected elfcc_procdata;
+/*     struct el_t2_data_t2 elfcc_t2data;              */
+/*     struct el_t2_data_memory elfcc_memdata[4];      */
+       struct el_t2_frame_header elfcc_footer; /* empty */
+};
+
+
+#ifdef __KERNEL__
+
+#ifndef __EXTERN_INLINE
+#define __EXTERN_INLINE extern inline
+#define __IO_EXTERN_INLINE
+#endif
+
+/*
+ * I/O functions:
+ *
+ * T2 (the core logic PCI/memory support chipset for the SABLE
+ * series of processors uses a sparse address mapping scheme to
+ * get at PCI memory and I/O.
+ */
+
+#define vip    volatile int *
+#define vuip   volatile unsigned int *
+
+extern inline u8 t2_inb(unsigned long addr)
+{
+       long result = *(vip) ((addr << 5) + T2_IO + 0x00);
+       return __kernel_extbl(result, addr & 3);
+}
+
+extern inline void t2_outb(u8 b, unsigned long addr)
+{
+       unsigned long w;
+
+       w = __kernel_insbl(b, addr & 3);
+       *(vuip) ((addr << 5) + T2_IO + 0x00) = w;
+       mb();
+}
+
+extern inline u16 t2_inw(unsigned long addr)
+{
+       long result = *(vip) ((addr << 5) + T2_IO + 0x08);
+       return __kernel_extwl(result, addr & 3);
+}
+
+extern inline void t2_outw(u16 b, unsigned long addr)
+{
+       unsigned long w;
+
+       w = __kernel_inswl(b, addr & 3);
+       *(vuip) ((addr << 5) + T2_IO + 0x08) = w;
+       mb();
+}
+
+extern inline u32 t2_inl(unsigned long addr)
+{
+       return *(vuip) ((addr << 5) + T2_IO + 0x18);
+}
+
+extern inline void t2_outl(u32 b, unsigned long addr)
+{
+       *(vuip) ((addr << 5) + T2_IO + 0x18) = b;
+       mb();
+}
+
+
+/*
+ * Memory functions.
+ *
+ * For reading and writing 8 and 16 bit quantities we need to
+ * go through one of the three sparse address mapping regions
+ * and use the HAE_MEM CSR to provide some bits of the address.
+ * The following few routines use only sparse address region 1
+ * which gives 1Gbyte of accessible space which relates exactly
+ * to the amount of PCI memory mapping *into* system address space.
+ * See p 6-17 of the specification but it looks something like this:
+ *
+ * 21164 Address:
+ *
+ *          3         2         1
+ * 9876543210987654321098765432109876543210
+ * 1ZZZZ0.PCI.QW.Address............BBLL
+ *
+ * ZZ = SBZ
+ * BB = Byte offset
+ * LL = Transfer length
+ *
+ * PCI Address:
+ *
+ * 3         2         1
+ * 10987654321098765432109876543210
+ * HHH....PCI.QW.Address........ 00
+ *
+ * HHH = 31:29 HAE_MEM CSR
+ *
+ */
+
+#define t2_set_hae { \
+       msb = addr  >> 27; \
+       addr &= T2_MEM_R1_MASK; \
+       set_hae(msb); \
+}
+
+extern spinlock_t t2_hae_lock;
+
+/*
+ * NOTE: take T2_DENSE_MEM off in each readX/writeX routine, since
+ *       they may be called directly, rather than through the
+ *       ioreadNN/iowriteNN routines.
+ */
+
+__EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
+       unsigned long result, msb;
+       unsigned long flags;
+       spin_lock_irqsave(&t2_hae_lock, flags);
+
+       t2_set_hae;
+
+       result = *(vip) ((addr << 5) + T2_SPARSE_MEM + 0x00);
+       spin_unlock_irqrestore(&t2_hae_lock, flags);
+       return __kernel_extbl(result, addr & 3);
+}
+
+__EXTERN_INLINE u16 t2_readw(const volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
+       unsigned long result, msb;
+       unsigned long flags;
+       spin_lock_irqsave(&t2_hae_lock, flags);
+
+       t2_set_hae;
+
+       result = *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x08);
+       spin_unlock_irqrestore(&t2_hae_lock, flags);
+       return __kernel_extwl(result, addr & 3);
+}
+
+/*
+ * On SABLE with T2, we must use SPARSE memory even for 32-bit access,
+ * because we cannot access all of DENSE without changing its HAE.
+ */
+__EXTERN_INLINE u32 t2_readl(const volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
+       unsigned long result, msb;
+       unsigned long flags;
+       spin_lock_irqsave(&t2_hae_lock, flags);
+
+       t2_set_hae;
+
+       result = *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18);
+       spin_unlock_irqrestore(&t2_hae_lock, flags);
+       return result & 0xffffffffUL;
+}
+
+__EXTERN_INLINE u64 t2_readq(const volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
+       unsigned long r0, r1, work, msb;
+       unsigned long flags;
+       spin_lock_irqsave(&t2_hae_lock, flags);
+
+       t2_set_hae;
+
+       work = (addr << 5) + T2_SPARSE_MEM + 0x18;
+       r0 = *(vuip)(work);
+       r1 = *(vuip)(work + (4 << 5));
+       spin_unlock_irqrestore(&t2_hae_lock, flags);
+       return r1 << 32 | r0;
+}
+
+__EXTERN_INLINE void t2_writeb(u8 b, volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
+       unsigned long msb, w;
+       unsigned long flags;
+       spin_lock_irqsave(&t2_hae_lock, flags);
+
+       t2_set_hae;
+
+       w = __kernel_insbl(b, addr & 3);
+       *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x00) = w;
+       spin_unlock_irqrestore(&t2_hae_lock, flags);
+}
+
+__EXTERN_INLINE void t2_writew(u16 b, volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
+       unsigned long msb, w;
+       unsigned long flags;
+       spin_lock_irqsave(&t2_hae_lock, flags);
+
+       t2_set_hae;
+
+       w = __kernel_inswl(b, addr & 3);
+       *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x08) = w;
+       spin_unlock_irqrestore(&t2_hae_lock, flags);
+}
+
+/*
+ * On SABLE with T2, we must use SPARSE memory even for 32-bit access,
+ * because we cannot access all of DENSE without changing its HAE.
+ */
+__EXTERN_INLINE void t2_writel(u32 b, volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
+       unsigned long msb;
+       unsigned long flags;
+       spin_lock_irqsave(&t2_hae_lock, flags);
+
+       t2_set_hae;
+
+       *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18) = b;
+       spin_unlock_irqrestore(&t2_hae_lock, flags);
+}
+
+__EXTERN_INLINE void t2_writeq(u64 b, volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
+       unsigned long msb, work;
+       unsigned long flags;
+       spin_lock_irqsave(&t2_hae_lock, flags);
+
+       t2_set_hae;
+
+       work = (addr << 5) + T2_SPARSE_MEM + 0x18;
+       *(vuip)work = b;
+       *(vuip)(work + (4 << 5)) = b >> 32;
+       spin_unlock_irqrestore(&t2_hae_lock, flags);
+}
+
+__EXTERN_INLINE void __iomem *t2_ioportmap(unsigned long addr)
+{
+       return (void __iomem *)(addr + T2_IO);
+}
+
+__EXTERN_INLINE void __iomem *t2_ioremap(unsigned long addr, 
+                                        unsigned long size)
+{
+       return (void __iomem *)(addr + T2_DENSE_MEM);
+}
+
+__EXTERN_INLINE int t2_is_ioaddr(unsigned long addr)
+{
+       return (long)addr >= 0;
+}
+
+__EXTERN_INLINE int t2_is_mmio(const volatile void __iomem *addr)
+{
+       return (unsigned long)addr >= T2_DENSE_MEM;
+}
+
+/* New-style ioread interface.  The mmio routines are so ugly for T2 that
+   it doesn't make sense to merge the pio and mmio routines.  */
+
+#define IOPORT(OS, NS)                                                 \
+__EXTERN_INLINE unsigned int t2_ioread##NS(void __iomem *xaddr)                \
+{                                                                      \
+       if (t2_is_mmio(xaddr))                                          \
+               return t2_read##OS(xaddr);                              \
+       else                                                            \
+               return t2_in##OS((unsigned long)xaddr - T2_IO);         \
+}                                                                      \
+__EXTERN_INLINE void t2_iowrite##NS(u##NS b, void __iomem *xaddr)      \
+{                                                                      \
+       if (t2_is_mmio(xaddr))                                          \
+               t2_write##OS(b, xaddr);                                 \
+       else                                                            \
+               t2_out##OS(b, (unsigned long)xaddr - T2_IO);            \
+}
+
+IOPORT(b, 8)
+IOPORT(w, 16)
+IOPORT(l, 32)
+
+#undef IOPORT
+
+#undef vip
+#undef vuip
+
+#undef __IO_PREFIX
+#define __IO_PREFIX            t2
+#define t2_trivial_rw_bw       0
+#define t2_trivial_rw_lq       0
+#define t2_trivial_io_bw       0
+#define t2_trivial_io_lq       0
+#define t2_trivial_iounmap     1
+#include <asm/io_trivial.h>
+
+#ifdef __IO_EXTERN_INLINE
+#undef __EXTERN_INLINE
+#undef __IO_EXTERN_INLINE
+#endif
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_T2__H__ */
diff --git a/arch/alpha/include/asm/core_titan.h b/arch/alpha/include/asm/core_titan.h
new file mode 100644 (file)
index 0000000..a17f6f3
--- /dev/null
@@ -0,0 +1,410 @@
+#ifndef __ALPHA_TITAN__H__
+#define __ALPHA_TITAN__H__
+
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <asm/compiler.h>
+
+/*
+ * TITAN is the internal names for a core logic chipset which provides
+ * memory controller and PCI/AGP access for 21264 based systems.
+ *
+ * This file is based on:
+ *
+ * Titan Chipset Engineering Specification
+ * Revision 0.12
+ * 13 July 1999
+ *
+ */
+
+/* XXX: Do we need to conditionalize on this?  */
+#ifdef USE_48_BIT_KSEG
+#define TI_BIAS 0x80000000000UL
+#else
+#define TI_BIAS 0x10000000000UL
+#endif
+
+/*
+ * CChip, DChip, and PChip registers
+ */
+
+typedef struct {
+       volatile unsigned long csr __attribute__((aligned(64)));
+} titan_64;
+
+typedef struct {
+       titan_64        csc;
+       titan_64        mtr;
+       titan_64        misc;
+       titan_64        mpd;
+       titan_64        aar0;
+       titan_64        aar1;
+       titan_64        aar2;
+       titan_64        aar3;
+       titan_64        dim0;
+       titan_64        dim1;
+       titan_64        dir0;
+       titan_64        dir1;
+       titan_64        drir;
+       titan_64        prben;
+       titan_64        iic0;
+       titan_64        iic1;
+       titan_64        mpr0;
+       titan_64        mpr1;
+       titan_64        mpr2;
+       titan_64        mpr3;
+       titan_64        rsvd[2];
+       titan_64        ttr;
+       titan_64        tdr;
+       titan_64        dim2;
+       titan_64        dim3;
+       titan_64        dir2;
+       titan_64        dir3;
+       titan_64        iic2;
+       titan_64        iic3;
+       titan_64        pwr;
+       titan_64        reserved[17];
+       titan_64        cmonctla;
+       titan_64        cmonctlb;
+       titan_64        cmoncnt01;
+       titan_64        cmoncnt23;
+       titan_64        cpen;
+} titan_cchip;
+
+typedef struct {
+       titan_64        dsc;
+       titan_64        str;
+       titan_64        drev;
+       titan_64        dsc2;
+} titan_dchip;
+
+typedef struct {
+       titan_64        wsba[4];
+       titan_64        wsm[4];
+       titan_64        tba[4];
+       titan_64        pctl;
+       titan_64        plat;
+       titan_64        reserved0[2];
+       union {
+               struct {
+                       titan_64        serror;
+                       titan_64        serren;
+                       titan_64        serrset;
+                       titan_64        reserved0;
+                       titan_64        gperror;
+                       titan_64        gperren;
+                       titan_64        gperrset;
+                       titan_64        reserved1;
+                       titan_64        gtlbiv;
+                       titan_64        gtlbia;
+                       titan_64        reserved2[2];
+                       titan_64        sctl;
+                       titan_64        reserved3[3];
+               } g;
+               struct {
+                       titan_64        agperror;
+                       titan_64        agperren;
+                       titan_64        agperrset;
+                       titan_64        agplastwr;
+                       titan_64        aperror;
+                       titan_64        aperren;
+                       titan_64        aperrset;
+                       titan_64        reserved0;
+                       titan_64        atlbiv;
+                       titan_64        atlbia;
+                       titan_64        reserved1[6];
+               } a;
+       } port_specific;
+       titan_64        sprst;
+       titan_64        reserved1[31];
+} titan_pachip_port;
+
+typedef struct {
+       titan_pachip_port       g_port;
+       titan_pachip_port       a_port;
+} titan_pachip;
+
+#define TITAN_cchip    ((titan_cchip  *)(IDENT_ADDR+TI_BIAS+0x1A0000000UL))
+#define TITAN_dchip            ((titan_dchip  *)(IDENT_ADDR+TI_BIAS+0x1B0000800UL))
+#define TITAN_pachip0  ((titan_pachip *)(IDENT_ADDR+TI_BIAS+0x180000000UL))
+#define TITAN_pachip1  ((titan_pachip *)(IDENT_ADDR+TI_BIAS+0x380000000UL))
+extern unsigned TITAN_agp;
+extern int TITAN_bootcpu;
+
+/*
+ * TITAN PA-chip Window Space Base Address register.
+ * (WSBA[0-2])
+ */
+#define wsba_m_ena 0x1                
+#define wsba_m_sg 0x2
+#define wsba_m_addr 0xFFF00000  
+#define wmask_k_sz1gb 0x3FF00000                   
+union TPAchipWSBA {
+       struct  {
+               unsigned wsba_v_ena : 1;
+               unsigned wsba_v_sg : 1;
+               unsigned wsba_v_rsvd1 : 18;
+               unsigned wsba_v_addr : 12;
+               unsigned wsba_v_rsvd2 : 32;
+        } wsba_r_bits;
+       int wsba_q_whole [2];
+};
+
+/*
+ * TITAN PA-chip Control Register
+ * This definition covers both the G-Port GPCTL and the A-PORT APCTL.
+ * Bits <51:0> are the same in both cases. APCTL<63:52> are only 
+ * applicable to AGP.
+ */
+#define pctl_m_fbtb                    0x00000001
+#define pctl_m_thdis                   0x00000002
+#define pctl_m_chaindis                0x00000004
+#define pctl_m_tgtlat                  0x00000018
+#define pctl_m_hole                    0x00000020
+#define pctl_m_mwin                    0x00000040
+#define pctl_m_arbena                  0x00000080
+#define pctl_m_prigrp                  0x0000FF00
+#define pctl_m_ppri                    0x00010000
+#define pctl_m_pcispd66                0x00020000
+#define pctl_m_cngstlt                 0x003C0000
+#define pctl_m_ptpdesten               0x3FC00000
+#define pctl_m_dpcen                   0x40000000
+#define pctl_m_apcen           0x0000000080000000UL
+#define pctl_m_dcrtv           0x0000000300000000UL
+#define pctl_m_en_stepping     0x0000000400000000UL
+#define apctl_m_rsvd1          0x000FFFF800000000UL
+#define apctl_m_agp_rate       0x0030000000000000UL
+#define apctl_m_agp_sba_en     0x0040000000000000UL
+#define apctl_m_agp_en         0x0080000000000000UL
+#define apctl_m_rsvd2          0x0100000000000000UL
+#define apctl_m_agp_present    0x0200000000000000UL
+#define apctl_agp_hp_rd                0x1C00000000000000UL
+#define apctl_agp_lp_rd                0xE000000000000000UL
+#define gpctl_m_rsvd           0xFFFFFFF800000000UL
+union TPAchipPCTL {
+       struct {
+               unsigned pctl_v_fbtb : 1;               /* A/G [0]     */
+               unsigned pctl_v_thdis : 1;              /* A/G [1]     */
+               unsigned pctl_v_chaindis : 1;           /* A/G [2]     */
+               unsigned pctl_v_tgtlat : 2;             /* A/G [4:3]   */
+               unsigned pctl_v_hole : 1;               /* A/G [5]     */
+               unsigned pctl_v_mwin : 1;               /* A/G [6]     */
+               unsigned pctl_v_arbena : 1;             /* A/G [7]     */
+               unsigned pctl_v_prigrp : 8;             /* A/G [15:8]  */
+               unsigned pctl_v_ppri : 1;               /* A/G [16]    */
+               unsigned pctl_v_pcispd66 : 1;           /* A/G [17]    */
+               unsigned pctl_v_cngstlt : 4;            /* A/G [21:18] */
+               unsigned pctl_v_ptpdesten : 8;          /* A/G [29:22] */
+               unsigned pctl_v_dpcen : 1;              /* A/G [30]    */
+               unsigned pctl_v_apcen : 1;              /* A/G [31]    */
+               unsigned pctl_v_dcrtv : 2;              /* A/G [33:32] */
+               unsigned pctl_v_en_stepping :1;         /* A/G [34]    */
+               unsigned apctl_v_rsvd1 : 17;            /* A   [51:35] */
+               unsigned apctl_v_agp_rate : 2;          /* A   [53:52] */
+               unsigned apctl_v_agp_sba_en : 1;        /* A   [54]    */
+               unsigned apctl_v_agp_en : 1;            /* A   [55]    */
+               unsigned apctl_v_rsvd2 : 1;             /* A   [56]    */
+               unsigned apctl_v_agp_present : 1;       /* A   [57]    */
+               unsigned apctl_v_agp_hp_rd : 3;         /* A   [60:58] */
+               unsigned apctl_v_agp_lp_rd : 3;         /* A   [63:61] */
+       } pctl_r_bits;
+       unsigned int pctl_l_whole [2];
+       unsigned long pctl_q_whole;
+};
+
+/*
+ * SERROR / SERREN / SERRSET
+ */
+union TPAchipSERR {
+       struct {
+               unsigned serr_v_lost_uecc : 1;          /* [0]          */
+               unsigned serr_v_uecc : 1;               /* [1]          */
+               unsigned serr_v_cre : 1;                /* [2]          */
+               unsigned serr_v_nxio : 1;               /* [3]          */
+               unsigned serr_v_lost_cre : 1;           /* [4]          */
+               unsigned serr_v_rsvd0 : 10;             /* [14:5]       */
+               unsigned serr_v_addr : 32;              /* [46:15]      */
+               unsigned serr_v_rsvd1 : 5;              /* [51:47]      */
+               unsigned serr_v_source : 2;             /* [53:52]      */
+               unsigned serr_v_cmd : 2;                /* [55:54]      */
+               unsigned serr_v_syn : 8;                /* [63:56]      */
+       } serr_r_bits;
+       unsigned int serr_l_whole[2];
+       unsigned long serr_q_whole;
+};
+
+/*
+ * GPERROR / APERROR / GPERREN / APERREN / GPERRSET / APERRSET
+ */
+union TPAchipPERR {
+       struct {
+               unsigned long perr_v_lost : 1;          /* [0]          */
+               unsigned long perr_v_serr : 1;          /* [1]          */
+               unsigned long perr_v_perr : 1;          /* [2]          */
+               unsigned long perr_v_dcrto : 1;         /* [3]          */
+               unsigned long perr_v_sge : 1;           /* [4]          */
+               unsigned long perr_v_ape : 1;           /* [5]          */
+               unsigned long perr_v_ta : 1;            /* [6]          */
+               unsigned long perr_v_dpe : 1;           /* [7]          */
+               unsigned long perr_v_nds : 1;           /* [8]          */
+               unsigned long perr_v_iptpr : 1;         /* [9]          */
+               unsigned long perr_v_iptpw : 1;         /* [10]         */
+               unsigned long perr_v_rsvd0 : 3;         /* [13:11]      */
+               unsigned long perr_v_addr : 33;         /* [46:14]      */
+               unsigned long perr_v_dac : 1;           /* [47]         */
+               unsigned long perr_v_mwin : 1;          /* [48]         */
+               unsigned long perr_v_rsvd1 : 3;         /* [51:49]      */
+               unsigned long perr_v_cmd : 4;           /* [55:52]      */
+               unsigned long perr_v_rsvd2 : 8;         /* [63:56]      */
+       } perr_r_bits;
+       unsigned int perr_l_whole[2];
+       unsigned long perr_q_whole;
+};
+
+/*
+ * AGPERROR / AGPERREN / AGPERRSET
+ */
+union TPAchipAGPERR {
+       struct {
+               unsigned agperr_v_lost : 1;             /* [0]          */
+               unsigned agperr_v_lpqfull : 1;          /* [1]          */
+               unsigned apgerr_v_hpqfull : 1;          /* [2]          */
+               unsigned agperr_v_rescmd : 1;           /* [3]          */
+               unsigned agperr_v_ipte : 1;             /* [4]          */
+               unsigned agperr_v_ptp : 1;              /* [5]          */
+               unsigned agperr_v_nowindow : 1;         /* [6]          */
+               unsigned agperr_v_rsvd0 : 8;            /* [14:7]       */
+               unsigned agperr_v_addr : 32;            /* [46:15]      */
+               unsigned agperr_v_rsvd1 : 1;            /* [47]         */
+               unsigned agperr_v_dac : 1;              /* [48]         */
+               unsigned agperr_v_mwin : 1;             /* [49]         */
+               unsigned agperr_v_cmd : 3;              /* [52:50]      */
+               unsigned agperr_v_length : 6;           /* [58:53]      */
+               unsigned agperr_v_fence : 1;            /* [59]         */
+               unsigned agperr_v_rsvd2 : 4;            /* [63:60]      */
+       } agperr_r_bits;
+       unsigned int agperr_l_whole[2];
+       unsigned long agperr_q_whole;
+};
+/*
+ * Memory spaces:
+ * Hose numbers are assigned as follows:
+ *             0 - pachip 0 / G Port
+ *             1 - pachip 1 / G Port
+ *             2 - pachip 0 / A Port
+ *             3 - pachip 1 / A Port
+ */
+#define TITAN_HOSE_SHIFT       (33) 
+#define TITAN_HOSE(h)          (((unsigned long)(h)) << TITAN_HOSE_SHIFT)
+#define TITAN_BASE             (IDENT_ADDR + TI_BIAS)
+#define TITAN_MEM(h)           (TITAN_BASE+TITAN_HOSE(h)+0x000000000UL)
+#define _TITAN_IACK_SC(h)      (TITAN_BASE+TITAN_HOSE(h)+0x1F8000000UL)
+#define TITAN_IO(h)            (TITAN_BASE+TITAN_HOSE(h)+0x1FC000000UL)
+#define TITAN_CONF(h)          (TITAN_BASE+TITAN_HOSE(h)+0x1FE000000UL)
+
+#define TITAN_HOSE_MASK                TITAN_HOSE(3)
+#define TITAN_IACK_SC          _TITAN_IACK_SC(0) /* hack! */
+
+/* 
+ * The canonical non-remaped I/O and MEM addresses have these values
+ * subtracted out.  This is arranged so that folks manipulating ISA
+ * devices can use their familiar numbers and have them map to bus 0.
+ */
+
+#define TITAN_IO_BIAS          TITAN_IO(0)
+#define TITAN_MEM_BIAS         TITAN_MEM(0)
+
+/* The IO address space is larger than 0xffff */
+#define TITAN_IO_SPACE         (TITAN_CONF(0) - TITAN_IO(0))
+
+/* TIG Space */
+#define TITAN_TIG_SPACE                (TITAN_BASE + 0x100000000UL)
+
+/* Offset between ram physical addresses and pci64 DAC bus addresses.  */
+/* ??? Just a guess.  Ought to confirm it hasn't been moved.  */
+#define TITAN_DAC_OFFSET       (1UL << 40)
+
+/*
+ * Data structure for handling TITAN machine checks:
+ */
+#define SCB_Q_SYSERR   0x620
+#define SCB_Q_PROCERR  0x630
+#define SCB_Q_SYSMCHK  0x660
+#define SCB_Q_PROCMCHK 0x670
+#define SCB_Q_SYSEVENT 0x680   /* environmental / system management */
+struct el_TITAN_sysdata_mcheck {
+       u64 summary;    /* 0x00 */
+       u64 c_dirx;     /* 0x08 */
+       u64 c_misc;     /* 0x10 */
+       u64 p0_serror;  /* 0x18 */
+       u64 p0_gperror; /* 0x20 */
+       u64 p0_aperror; /* 0x28 */
+       u64 p0_agperror;/* 0x30 */
+       u64 p1_serror;  /* 0x38 */
+       u64 p1_gperror; /* 0x40 */
+       u64 p1_aperror; /* 0x48 */
+       u64 p1_agperror;/* 0x50 */
+};
+
+/*
+ * System area for a privateer 680 environmental/system management mcheck 
+ */
+struct el_PRIVATEER_envdata_mcheck {
+       u64 summary;    /* 0x00 */
+       u64 c_dirx;     /* 0x08 */
+       u64 smir;       /* 0x10 */
+       u64 cpuir;      /* 0x18 */
+       u64 psir;       /* 0x20 */
+       u64 fault;      /* 0x28 */
+       u64 sys_doors;  /* 0x30 */
+       u64 temp_warn;  /* 0x38 */
+       u64 fan_ctrl;   /* 0x40 */
+       u64 code;       /* 0x48 */
+       u64 reserved;   /* 0x50 */
+};
+
+#ifdef __KERNEL__
+
+#ifndef __EXTERN_INLINE
+#define __EXTERN_INLINE extern inline
+#define __IO_EXTERN_INLINE
+#endif
+
+/*
+ * I/O functions:
+ *
+ * TITAN, a 21??? PCI/memory support chipset for the EV6 (21264)
+ * can only use linear accesses to get at PCI/AGP memory and I/O spaces.
+ */
+
+/*
+ * Memory functions.  all accesses are done through linear space.
+ */
+extern void __iomem *titan_ioportmap(unsigned long addr);
+extern void __iomem *titan_ioremap(unsigned long addr, unsigned long size);
+extern void titan_iounmap(volatile void __iomem *addr);
+
+__EXTERN_INLINE int titan_is_ioaddr(unsigned long addr)
+{
+       return addr >= TITAN_BASE;
+}
+
+extern int titan_is_mmio(const volatile void __iomem *addr);
+
+#undef __IO_PREFIX
+#define __IO_PREFIX            titan
+#define titan_trivial_rw_bw    1
+#define titan_trivial_rw_lq    1
+#define titan_trivial_io_bw    1
+#define titan_trivial_io_lq    1
+#define titan_trivial_iounmap  0
+#include <asm/io_trivial.h>
+
+#ifdef __IO_EXTERN_INLINE
+#undef __EXTERN_INLINE
+#undef __IO_EXTERN_INLINE
+#endif
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_TITAN__H__ */
diff --git a/arch/alpha/include/asm/core_tsunami.h b/arch/alpha/include/asm/core_tsunami.h
new file mode 100644 (file)
index 0000000..58d4fe4
--- /dev/null
@@ -0,0 +1,335 @@
+#ifndef __ALPHA_TSUNAMI__H__
+#define __ALPHA_TSUNAMI__H__
+
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <asm/compiler.h>
+
+/*
+ * TSUNAMI/TYPHOON are the internal names for the core logic chipset which
+ * provides memory controller and PCI access for the 21264 based systems.
+ *
+ * This file is based on:
+ *
+ * Tsunami System Programmers Manual
+ * Preliminary, Chapters 2-5
+ *
+ */
+
+/* XXX: Do we need to conditionalize on this?  */
+#ifdef USE_48_BIT_KSEG
+#define TS_BIAS 0x80000000000UL
+#else
+#define TS_BIAS 0x10000000000UL
+#endif
+
+/*
+ * CChip, DChip, and PChip registers
+ */
+
+typedef struct {
+       volatile unsigned long csr __attribute__((aligned(64)));
+} tsunami_64;
+
+typedef struct {
+       tsunami_64      csc;
+       tsunami_64      mtr;
+       tsunami_64      misc;
+       tsunami_64      mpd;
+       tsunami_64      aar0;
+       tsunami_64      aar1;
+       tsunami_64      aar2;
+       tsunami_64      aar3;
+       tsunami_64      dim0;
+       tsunami_64      dim1;
+       tsunami_64      dir0;
+       tsunami_64      dir1;
+       tsunami_64      drir;
+       tsunami_64      prben;
+       tsunami_64      iic;    /* a.k.a. iic0 */
+       tsunami_64      wdr;    /* a.k.a. iic1 */
+       tsunami_64      mpr0;
+       tsunami_64      mpr1;
+       tsunami_64      mpr2;
+       tsunami_64      mpr3;
+       tsunami_64      mctl;
+       tsunami_64      __pad1;
+       tsunami_64      ttr;
+       tsunami_64      tdr;
+       tsunami_64      dim2;
+       tsunami_64      dim3;
+       tsunami_64      dir2;
+       tsunami_64      dir3;
+       tsunami_64      iic2;
+       tsunami_64      iic3;
+} tsunami_cchip;
+
+typedef struct {
+       tsunami_64      dsc;
+       tsunami_64      str;
+       tsunami_64      drev;
+} tsunami_dchip;
+
+typedef struct {
+       tsunami_64      wsba[4];
+       tsunami_64      wsm[4];
+       tsunami_64      tba[4];
+       tsunami_64      pctl;
+       tsunami_64      plat;
+       tsunami_64      reserved;
+       tsunami_64      perror;
+       tsunami_64      perrmask;
+       tsunami_64      perrset;
+       tsunami_64      tlbiv;
+       tsunami_64      tlbia;
+       tsunami_64      pmonctl;
+       tsunami_64      pmoncnt;
+} tsunami_pchip;
+
+#define TSUNAMI_cchip  ((tsunami_cchip *)(IDENT_ADDR+TS_BIAS+0x1A0000000UL))
+#define TSUNAMI_dchip  ((tsunami_dchip *)(IDENT_ADDR+TS_BIAS+0x1B0000800UL))
+#define TSUNAMI_pchip0 ((tsunami_pchip *)(IDENT_ADDR+TS_BIAS+0x180000000UL))
+#define TSUNAMI_pchip1 ((tsunami_pchip *)(IDENT_ADDR+TS_BIAS+0x380000000UL))
+extern int TSUNAMI_bootcpu;
+
+/*
+ * TSUNAMI Pchip Error register.
+ */
+
+#define perror_m_lost 0x1
+#define perror_m_serr 0x2
+#define perror_m_perr 0x4
+#define perror_m_dcrto 0x8
+#define perror_m_sge 0x10
+#define perror_m_ape 0x20
+#define perror_m_ta 0x40
+#define perror_m_rdpe 0x80
+#define perror_m_nds 0x100
+#define perror_m_rto 0x200
+#define perror_m_uecc 0x400
+#define perror_m_cre 0x800
+#define perror_m_addrl 0xFFFFFFFF0000UL
+#define perror_m_addrh 0x7000000000000UL
+#define perror_m_cmd 0xF0000000000000UL
+#define perror_m_syn 0xFF00000000000000UL
+union TPchipPERROR {   
+       struct  {
+               unsigned int perror_v_lost : 1;
+               unsigned perror_v_serr : 1;
+               unsigned perror_v_perr : 1;
+               unsigned perror_v_dcrto : 1;
+               unsigned perror_v_sge : 1;
+               unsigned perror_v_ape : 1;
+               unsigned perror_v_ta : 1;
+               unsigned perror_v_rdpe : 1;
+               unsigned perror_v_nds : 1;
+               unsigned perror_v_rto : 1;
+               unsigned perror_v_uecc : 1;
+               unsigned perror_v_cre : 1;                 
+               unsigned perror_v_rsvd1 : 4;
+               unsigned perror_v_addrl : 32;
+               unsigned perror_v_addrh : 3;
+               unsigned perror_v_rsvd2 : 1;
+               unsigned perror_v_cmd : 4;
+               unsigned perror_v_syn : 8;
+       } perror_r_bits;
+       int perror_q_whole [2];
+};                       
+
+/*
+ * TSUNAMI Pchip Window Space Base Address register.
+ */
+#define wsba_m_ena 0x1                
+#define wsba_m_sg 0x2
+#define wsba_m_ptp 0x4
+#define wsba_m_addr 0xFFF00000  
+#define wmask_k_sz1gb 0x3FF00000                   
+union TPchipWSBA {
+       struct  {
+               unsigned wsba_v_ena : 1;
+               unsigned wsba_v_sg : 1;
+               unsigned wsba_v_ptp : 1;
+               unsigned wsba_v_rsvd1 : 17;
+               unsigned wsba_v_addr : 12;
+               unsigned wsba_v_rsvd2 : 32;
+       } wsba_r_bits;
+       int wsba_q_whole [2];
+};
+
+/*
+ * TSUNAMI Pchip Control Register
+ */
+#define pctl_m_fdsc 0x1
+#define pctl_m_fbtb 0x2
+#define pctl_m_thdis 0x4
+#define pctl_m_chaindis 0x8
+#define pctl_m_tgtlat 0x10
+#define pctl_m_hole 0x20
+#define pctl_m_mwin 0x40
+#define pctl_m_arbena 0x80
+#define pctl_m_prigrp 0x7F00
+#define pctl_m_ppri 0x8000
+#define pctl_m_rsvd1 0x30000
+#define pctl_m_eccen 0x40000
+#define pctl_m_padm 0x80000
+#define pctl_m_cdqmax 0xF00000
+#define pctl_m_rev 0xFF000000
+#define pctl_m_crqmax 0xF00000000UL
+#define pctl_m_ptpmax 0xF000000000UL
+#define pctl_m_pclkx 0x30000000000UL
+#define pctl_m_fdsdis 0x40000000000UL
+#define pctl_m_fdwdis 0x80000000000UL
+#define pctl_m_ptevrfy 0x100000000000UL
+#define pctl_m_rpp 0x200000000000UL
+#define pctl_m_pid 0xC00000000000UL
+#define pctl_m_rsvd2 0xFFFF000000000000UL
+
+union TPchipPCTL {
+       struct {
+               unsigned pctl_v_fdsc : 1;
+               unsigned pctl_v_fbtb : 1;
+               unsigned pctl_v_thdis : 1;
+               unsigned pctl_v_chaindis : 1;
+               unsigned pctl_v_tgtlat : 1;
+               unsigned pctl_v_hole : 1;
+               unsigned pctl_v_mwin : 1;
+               unsigned pctl_v_arbena : 1;
+               unsigned pctl_v_prigrp : 7;
+               unsigned pctl_v_ppri : 1;
+               unsigned pctl_v_rsvd1 : 2;
+               unsigned pctl_v_eccen : 1;
+               unsigned pctl_v_padm : 1;
+               unsigned pctl_v_cdqmax : 4;
+               unsigned pctl_v_rev : 8;
+               unsigned pctl_v_crqmax : 4;
+               unsigned pctl_v_ptpmax : 4;
+               unsigned pctl_v_pclkx : 2;
+               unsigned pctl_v_fdsdis : 1;
+               unsigned pctl_v_fdwdis : 1;
+               unsigned pctl_v_ptevrfy : 1;
+               unsigned pctl_v_rpp : 1;
+               unsigned pctl_v_pid : 2;
+               unsigned pctl_v_rsvd2 : 16;
+       } pctl_r_bits;
+       int pctl_q_whole [2];
+};
+
+/*
+ * TSUNAMI Pchip Error Mask Register.
+ */
+#define perrmask_m_lost 0x1
+#define perrmask_m_serr 0x2
+#define perrmask_m_perr 0x4
+#define perrmask_m_dcrto 0x8
+#define perrmask_m_sge 0x10
+#define perrmask_m_ape 0x20
+#define perrmask_m_ta 0x40
+#define perrmask_m_rdpe 0x80
+#define perrmask_m_nds 0x100
+#define perrmask_m_rto 0x200
+#define perrmask_m_uecc 0x400
+#define perrmask_m_cre 0x800
+#define perrmask_m_rsvd 0xFFFFFFFFFFFFF000UL
+union TPchipPERRMASK {   
+       struct  {
+               unsigned int perrmask_v_lost : 1;
+               unsigned perrmask_v_serr : 1;
+               unsigned perrmask_v_perr : 1;
+               unsigned perrmask_v_dcrto : 1;
+               unsigned perrmask_v_sge : 1;
+               unsigned perrmask_v_ape : 1;
+               unsigned perrmask_v_ta : 1;
+               unsigned perrmask_v_rdpe : 1;
+               unsigned perrmask_v_nds : 1;
+               unsigned perrmask_v_rto : 1;
+               unsigned perrmask_v_uecc : 1;
+               unsigned perrmask_v_cre : 1;                 
+               unsigned perrmask_v_rsvd1 : 20;
+               unsigned perrmask_v_rsvd2 : 32;
+       } perrmask_r_bits;
+       int perrmask_q_whole [2];
+};                       
+
+/*
+ * Memory spaces:
+ */
+#define TSUNAMI_HOSE(h)                (((unsigned long)(h)) << 33)
+#define TSUNAMI_BASE           (IDENT_ADDR + TS_BIAS)
+
+#define TSUNAMI_MEM(h)         (TSUNAMI_BASE+TSUNAMI_HOSE(h) + 0x000000000UL)
+#define _TSUNAMI_IACK_SC(h)    (TSUNAMI_BASE+TSUNAMI_HOSE(h) + 0x1F8000000UL)
+#define TSUNAMI_IO(h)          (TSUNAMI_BASE+TSUNAMI_HOSE(h) + 0x1FC000000UL)
+#define TSUNAMI_CONF(h)                (TSUNAMI_BASE+TSUNAMI_HOSE(h) + 0x1FE000000UL)
+
+#define TSUNAMI_IACK_SC                _TSUNAMI_IACK_SC(0) /* hack! */
+
+
+/* 
+ * The canonical non-remaped I/O and MEM addresses have these values
+ * subtracted out.  This is arranged so that folks manipulating ISA
+ * devices can use their familiar numbers and have them map to bus 0.
+ */
+
+#define TSUNAMI_IO_BIAS          TSUNAMI_IO(0)
+#define TSUNAMI_MEM_BIAS         TSUNAMI_MEM(0)
+
+/* The IO address space is larger than 0xffff */
+#define TSUNAMI_IO_SPACE       (TSUNAMI_CONF(0) - TSUNAMI_IO(0))
+
+/* Offset between ram physical addresses and pci64 DAC bus addresses.  */
+#define TSUNAMI_DAC_OFFSET     (1UL << 40)
+
+/*
+ * Data structure for handling TSUNAMI machine checks:
+ */
+struct el_TSUNAMI_sysdata_mcheck {
+};
+
+
+#ifdef __KERNEL__
+
+#ifndef __EXTERN_INLINE
+#define __EXTERN_INLINE extern inline
+#define __IO_EXTERN_INLINE
+#endif
+
+/*
+ * I/O functions:
+ *
+ * TSUNAMI, the 21??? PCI/memory support chipset for the EV6 (21264)
+ * can only use linear accesses to get at PCI memory and I/O spaces.
+ */
+
+/*
+ * Memory functions.  all accesses are done through linear space.
+ */
+extern void __iomem *tsunami_ioportmap(unsigned long addr);
+extern void __iomem *tsunami_ioremap(unsigned long addr, unsigned long size);
+__EXTERN_INLINE int tsunami_is_ioaddr(unsigned long addr)
+{
+       return addr >= TSUNAMI_BASE;
+}
+
+__EXTERN_INLINE int tsunami_is_mmio(const volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       return (addr & 0x100000000UL) == 0;
+}
+
+#undef __IO_PREFIX
+#define __IO_PREFIX            tsunami
+#define tsunami_trivial_rw_bw  1
+#define tsunami_trivial_rw_lq  1
+#define tsunami_trivial_io_bw  1
+#define tsunami_trivial_io_lq  1
+#define tsunami_trivial_iounmap        1
+#include <asm/io_trivial.h>
+
+#ifdef __IO_EXTERN_INLINE
+#undef __EXTERN_INLINE
+#undef __IO_EXTERN_INLINE
+#endif
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_TSUNAMI__H__ */
diff --git a/arch/alpha/include/asm/core_wildfire.h b/arch/alpha/include/asm/core_wildfire.h
new file mode 100644 (file)
index 0000000..cd562f5
--- /dev/null
@@ -0,0 +1,318 @@
+#ifndef __ALPHA_WILDFIRE__H__
+#define __ALPHA_WILDFIRE__H__
+
+#include <linux/types.h>
+#include <asm/compiler.h>
+
+#define WILDFIRE_MAX_QBB       8       /* more than 8 requires other mods */
+#define WILDFIRE_PCA_PER_QBB   4
+#define WILDFIRE_IRQ_PER_PCA   64
+
+#define WILDFIRE_NR_IRQS \
+  (WILDFIRE_MAX_QBB * WILDFIRE_PCA_PER_QBB * WILDFIRE_IRQ_PER_PCA)
+
+extern unsigned char wildfire_hard_qbb_map[WILDFIRE_MAX_QBB];
+extern unsigned char wildfire_soft_qbb_map[WILDFIRE_MAX_QBB];
+#define QBB_MAP_EMPTY  0xff
+
+extern unsigned long wildfire_hard_qbb_mask;
+extern unsigned long wildfire_soft_qbb_mask;
+extern unsigned long wildfire_gp_mask;
+extern unsigned long wildfire_hs_mask;
+extern unsigned long wildfire_iop_mask;
+extern unsigned long wildfire_ior_mask;
+extern unsigned long wildfire_pca_mask;
+extern unsigned long wildfire_cpu_mask;
+extern unsigned long wildfire_mem_mask;
+
+#define WILDFIRE_QBB_EXISTS(qbbno) (wildfire_soft_qbb_mask & (1 << (qbbno)))
+
+#define WILDFIRE_MEM_EXISTS(qbbno) (wildfire_mem_mask & (0xf << ((qbbno) << 2)))
+
+#define WILDFIRE_PCA_EXISTS(qbbno, pcano) \
+               (wildfire_pca_mask & (1 << (((qbbno) << 2) + (pcano))))
+
+typedef struct {
+       volatile unsigned long csr __attribute__((aligned(64)));
+} wildfire_64;
+
+typedef struct {
+       volatile unsigned long csr __attribute__((aligned(256)));
+} wildfire_256;
+
+typedef struct {
+       volatile unsigned long csr __attribute__((aligned(2048)));
+} wildfire_2k;
+
+typedef struct {
+       wildfire_64     qsd_whami;
+       wildfire_64     qsd_rev;
+       wildfire_64     qsd_port_present;
+       wildfire_64     qsd_port_active;
+       wildfire_64     qsd_fault_ena;
+       wildfire_64     qsd_cpu_int_ena;
+       wildfire_64     qsd_mem_config;
+       wildfire_64     qsd_err_sum;
+       wildfire_64     ce_sum[4];
+       wildfire_64     dev_init[4];
+       wildfire_64     it_int[4];
+       wildfire_64     ip_int[4];
+       wildfire_64     uce_sum[4];
+       wildfire_64     se_sum__non_dev_int[4];
+       wildfire_64     scratch[4];
+       wildfire_64     qsd_timer;
+       wildfire_64     qsd_diag;
+} wildfire_qsd;
+
+typedef struct {
+       wildfire_256    qsd_whami;
+       wildfire_256    __pad1;
+       wildfire_256    ce_sum;
+       wildfire_256    dev_init;
+       wildfire_256    it_int;
+       wildfire_256    ip_int;
+       wildfire_256    uce_sum;
+       wildfire_256    se_sum;
+} wildfire_fast_qsd;
+
+typedef struct {
+       wildfire_2k     qsa_qbb_id;
+       wildfire_2k     __pad1;
+       wildfire_2k     qsa_port_ena;
+       wildfire_2k     qsa_scratch;
+       wildfire_2k     qsa_config[5];
+       wildfire_2k     qsa_ref_int;
+       wildfire_2k     qsa_qbb_pop[2];
+       wildfire_2k     qsa_dtag_fc;
+       wildfire_2k     __pad2[3];
+       wildfire_2k     qsa_diag;
+       wildfire_2k     qsa_diag_lock[4];
+       wildfire_2k     __pad3[11];
+       wildfire_2k     qsa_cpu_err_sum;
+       wildfire_2k     qsa_misc_err_sum;
+       wildfire_2k     qsa_tmo_err_sum;
+       wildfire_2k     qsa_err_ena;
+       wildfire_2k     qsa_tmo_config;
+       wildfire_2k     qsa_ill_cmd_err_sum;
+       wildfire_2k     __pad4[26];
+       wildfire_2k     qsa_busy_mask;
+       wildfire_2k     qsa_arr_valid;
+       wildfire_2k     __pad5[2];
+       wildfire_2k     qsa_port_map[4];
+       wildfire_2k     qsa_arr_addr[8];
+       wildfire_2k     qsa_arr_mask[8];
+} wildfire_qsa;
+
+typedef struct {
+       wildfire_64     ioa_config;
+       wildfire_64     iod_config;
+       wildfire_64     iop_switch_credits;
+       wildfire_64     __pad1;
+       wildfire_64     iop_hose_credits;
+       wildfire_64     __pad2[11];
+       struct {
+               wildfire_64     __pad3;
+               wildfire_64     init;
+       } iop_hose[4];
+       wildfire_64     ioa_hose_0_ctrl;
+       wildfire_64     iod_hose_0_ctrl;
+       wildfire_64     ioa_hose_1_ctrl;
+       wildfire_64     iod_hose_1_ctrl;
+       wildfire_64     ioa_hose_2_ctrl;
+       wildfire_64     iod_hose_2_ctrl;
+       wildfire_64     ioa_hose_3_ctrl;
+       wildfire_64     iod_hose_3_ctrl;
+       struct {
+               wildfire_64     target;
+               wildfire_64     __pad4;
+       } iop_dev_int[4];
+
+       wildfire_64     iop_err_int_target;
+       wildfire_64     __pad5[7];
+       wildfire_64     iop_qbb_err_sum;
+       wildfire_64     __pad6;
+       wildfire_64     iop_qbb_se_sum;
+       wildfire_64     __pad7;
+       wildfire_64     ioa_err_sum;
+       wildfire_64     iod_err_sum;
+       wildfire_64     __pad8[4];
+       wildfire_64     ioa_diag_force_err;
+       wildfire_64     iod_diag_force_err;
+       wildfire_64     __pad9[4];
+       wildfire_64     iop_diag_send_err_int;
+       wildfire_64     __pad10[15];
+       wildfire_64     ioa_scratch;
+       wildfire_64     iod_scratch;
+} wildfire_iop;
+
+typedef struct {
+       wildfire_2k     gpa_qbb_map[4];
+       wildfire_2k     gpa_mem_pop_map;
+       wildfire_2k     gpa_scratch;
+       wildfire_2k     gpa_diag;
+       wildfire_2k     gpa_config_0;
+       wildfire_2k     __pad1;
+       wildfire_2k     gpa_init_id;
+       wildfire_2k     gpa_config_2;
+       /* not complete */
+} wildfire_gp;
+
+typedef struct {
+       wildfire_64     pca_what_am_i;
+       wildfire_64     pca_err_sum;
+       wildfire_64     pca_diag_force_err;
+       wildfire_64     pca_diag_send_err_int;
+       wildfire_64     pca_hose_credits;
+       wildfire_64     pca_scratch;
+       wildfire_64     pca_micro_addr;
+       wildfire_64     pca_micro_data;
+       wildfire_64     pca_pend_int;
+       wildfire_64     pca_sent_int;
+       wildfire_64     __pad1;
+       wildfire_64     pca_stdio_edge_level;
+       wildfire_64     __pad2[52];
+       struct {
+               wildfire_64     target;
+               wildfire_64     enable;
+       } pca_int[4];
+       wildfire_64     __pad3[56];
+       wildfire_64     pca_alt_sent_int[32];
+} wildfire_pca;
+
+typedef struct {
+       wildfire_64     ne_what_am_i;
+       /* not complete */
+} wildfire_ne;
+
+typedef struct {
+       wildfire_64     fe_what_am_i;
+       /* not complete */
+} wildfire_fe;
+
+typedef struct {
+       wildfire_64     pci_io_addr_ext;
+       wildfire_64     pci_ctrl;
+       wildfire_64     pci_err_sum;
+       wildfire_64     pci_err_addr;
+       wildfire_64     pci_stall_cnt;
+       wildfire_64     pci_iack_special;
+       wildfire_64     __pad1[2];
+       wildfire_64     pci_pend_int;
+       wildfire_64     pci_sent_int;
+       wildfire_64     __pad2[54];
+       struct {
+               wildfire_64     wbase;
+               wildfire_64     wmask;
+               wildfire_64     tbase;
+       } pci_window[4];
+       wildfire_64     pci_flush_tlb;
+       wildfire_64     pci_perf_mon;
+} wildfire_pci;
+
+#define WILDFIRE_ENTITY_SHIFT          18
+
+#define WILDFIRE_GP_ENTITY             (0x10UL << WILDFIRE_ENTITY_SHIFT)
+#define WILDFIRE_IOP_ENTITY            (0x08UL << WILDFIRE_ENTITY_SHIFT)
+#define WILDFIRE_QSA_ENTITY            (0x04UL << WILDFIRE_ENTITY_SHIFT)
+#define WILDFIRE_QSD_ENTITY_SLOW       (0x05UL << WILDFIRE_ENTITY_SHIFT)
+#define WILDFIRE_QSD_ENTITY_FAST       (0x01UL << WILDFIRE_ENTITY_SHIFT)
+
+#define WILDFIRE_PCA_ENTITY(pca)       ((0xc|(pca))<<WILDFIRE_ENTITY_SHIFT)
+
+#define WILDFIRE_BASE          (IDENT_ADDR | (1UL << 40))
+
+#define WILDFIRE_QBB_MASK      0x0fUL  /* for now, only 4 bits/16 QBBs */
+
+#define WILDFIRE_QBB(q)                ((~((long)(q)) & WILDFIRE_QBB_MASK) << 36)
+#define WILDFIRE_HOSE(h)       ((long)(h) << 33)
+
+#define WILDFIRE_QBB_IO(q)     (WILDFIRE_BASE | WILDFIRE_QBB(q))
+#define WILDFIRE_QBB_HOSE(q,h) (WILDFIRE_QBB_IO(q) | WILDFIRE_HOSE(h))
+
+#define WILDFIRE_MEM(q,h)      (WILDFIRE_QBB_HOSE(q,h) | 0x000000000UL)
+#define WILDFIRE_CONF(q,h)     (WILDFIRE_QBB_HOSE(q,h) | 0x1FE000000UL)
+#define WILDFIRE_IO(q,h)       (WILDFIRE_QBB_HOSE(q,h) | 0x1FF000000UL)
+
+#define WILDFIRE_qsd(q) \
+ ((wildfire_qsd *)(WILDFIRE_QBB_IO(q)|WILDFIRE_QSD_ENTITY_SLOW|(((1UL<<13)-1)<<23)))
+
+#define WILDFIRE_fast_qsd() \
+ ((wildfire_fast_qsd *)(WILDFIRE_QBB_IO(0)|WILDFIRE_QSD_ENTITY_FAST|(((1UL<<13)-1)<<23)))
+
+#define WILDFIRE_qsa(q) \
+ ((wildfire_qsa *)(WILDFIRE_QBB_IO(q)|WILDFIRE_QSA_ENTITY|(((1UL<<13)-1)<<23)))
+
+#define WILDFIRE_iop(q) \
+ ((wildfire_iop *)(WILDFIRE_QBB_IO(q)|WILDFIRE_IOP_ENTITY|(((1UL<<13)-1)<<23)))
+
+#define WILDFIRE_gp(q) \
+ ((wildfire_gp *)(WILDFIRE_QBB_IO(q)|WILDFIRE_GP_ENTITY|(((1UL<<13)-1)<<23)))
+
+#define WILDFIRE_pca(q,pca) \
+ ((wildfire_pca *)(WILDFIRE_QBB_IO(q)|WILDFIRE_PCA_ENTITY(pca)|(((1UL<<13)-1)<<23)))
+
+#define WILDFIRE_ne(q,pca) \
+ ((wildfire_ne *)(WILDFIRE_QBB_IO(q)|WILDFIRE_PCA_ENTITY(pca)|(((1UL<<13)-1)<<23)|(1UL<<16)))
+
+#define WILDFIRE_fe(q,pca) \
+ ((wildfire_fe *)(WILDFIRE_QBB_IO(q)|WILDFIRE_PCA_ENTITY(pca)|(((1UL<<13)-1)<<23)|(3UL<<15)))
+
+#define WILDFIRE_pci(q,h) \
+ ((wildfire_pci *)(WILDFIRE_QBB_IO(q)|WILDFIRE_PCA_ENTITY(((h)&6)>>1)|((((h)&1)|2)<<16)|(((1UL<<13)-1)<<23)))
+
+#define WILDFIRE_IO_BIAS        WILDFIRE_IO(0,0)
+#define WILDFIRE_MEM_BIAS       WILDFIRE_MEM(0,0) /* ??? */
+
+/* The IO address space is larger than 0xffff */
+#define WILDFIRE_IO_SPACE      (8UL*1024*1024)
+
+#ifdef __KERNEL__
+
+#ifndef __EXTERN_INLINE
+#define __EXTERN_INLINE extern inline
+#define __IO_EXTERN_INLINE
+#endif
+
+/*
+ * Memory functions.  all accesses are done through linear space.
+ */
+
+__EXTERN_INLINE void __iomem *wildfire_ioportmap(unsigned long addr)
+{
+       return (void __iomem *)(addr + WILDFIRE_IO_BIAS);
+}
+
+__EXTERN_INLINE void __iomem *wildfire_ioremap(unsigned long addr, 
+                                              unsigned long size)
+{
+       return (void __iomem *)(addr + WILDFIRE_MEM_BIAS);
+}
+
+__EXTERN_INLINE int wildfire_is_ioaddr(unsigned long addr)
+{
+       return addr >= WILDFIRE_BASE;
+}
+
+__EXTERN_INLINE int wildfire_is_mmio(const volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long)xaddr;
+       return (addr & 0x100000000UL) == 0;
+}
+
+#undef __IO_PREFIX
+#define __IO_PREFIX                    wildfire
+#define wildfire_trivial_rw_bw         1
+#define wildfire_trivial_rw_lq         1
+#define wildfire_trivial_io_bw         1
+#define wildfire_trivial_io_lq         1
+#define wildfire_trivial_iounmap       1
+#include <asm/io_trivial.h>
+
+#ifdef __IO_EXTERN_INLINE
+#undef __EXTERN_INLINE
+#undef __IO_EXTERN_INLINE
+#endif
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_WILDFIRE__H__ */
diff --git a/arch/alpha/include/asm/cputime.h b/arch/alpha/include/asm/cputime.h
new file mode 100644 (file)
index 0000000..19577fd
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ALPHA_CPUTIME_H
+#define __ALPHA_CPUTIME_H
+
+#include <asm-generic/cputime.h>
+
+#endif /* __ALPHA_CPUTIME_H */
diff --git a/arch/alpha/include/asm/current.h b/arch/alpha/include/asm/current.h
new file mode 100644 (file)
index 0000000..094d285
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef _ALPHA_CURRENT_H
+#define _ALPHA_CURRENT_H
+
+#include <linux/thread_info.h>
+
+#define get_current()  (current_thread_info()->task)
+#define current                get_current()
+
+#endif /* _ALPHA_CURRENT_H */
diff --git a/arch/alpha/include/asm/delay.h b/arch/alpha/include/asm/delay.h
new file mode 100644 (file)
index 0000000..2aa3f41
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef __ALPHA_DELAY_H
+#define __ALPHA_DELAY_H
+
+extern void __delay(int loops);
+extern void udelay(unsigned long usecs);
+
+extern void ndelay(unsigned long nsecs);
+#define ndelay ndelay
+
+#endif /* defined(__ALPHA_DELAY_H) */
diff --git a/arch/alpha/include/asm/device.h b/arch/alpha/include/asm/device.h
new file mode 100644 (file)
index 0000000..d8f9872
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+ * Arch specific extensions to struct device
+ *
+ * This file is released under the GPLv2
+ */
+#include <asm-generic/device.h>
+
diff --git a/arch/alpha/include/asm/div64.h b/arch/alpha/include/asm/div64.h
new file mode 100644 (file)
index 0000000..6cd978c
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/div64.h>
diff --git a/arch/alpha/include/asm/dma-mapping.h b/arch/alpha/include/asm/dma-mapping.h
new file mode 100644 (file)
index 0000000..a5801ae
--- /dev/null
@@ -0,0 +1,69 @@
+#ifndef _ALPHA_DMA_MAPPING_H
+#define _ALPHA_DMA_MAPPING_H
+
+
+#ifdef CONFIG_PCI
+
+#include <linux/pci.h>
+
+#define dma_map_single(dev, va, size, dir)             \
+               pci_map_single(alpha_gendev_to_pci(dev), va, size, dir)
+#define dma_unmap_single(dev, addr, size, dir)         \
+               pci_unmap_single(alpha_gendev_to_pci(dev), addr, size, dir)
+#define dma_alloc_coherent(dev, size, addr, gfp)       \
+             __pci_alloc_consistent(alpha_gendev_to_pci(dev), size, addr, gfp)
+#define dma_free_coherent(dev, size, va, addr)         \
+               pci_free_consistent(alpha_gendev_to_pci(dev), size, va, addr)
+#define dma_map_page(dev, page, off, size, dir)                \
+               pci_map_page(alpha_gendev_to_pci(dev), page, off, size, dir)
+#define dma_unmap_page(dev, addr, size, dir)           \
+               pci_unmap_page(alpha_gendev_to_pci(dev), addr, size, dir)
+#define dma_map_sg(dev, sg, nents, dir)                        \
+               pci_map_sg(alpha_gendev_to_pci(dev), sg, nents, dir)
+#define dma_unmap_sg(dev, sg, nents, dir)              \
+               pci_unmap_sg(alpha_gendev_to_pci(dev), sg, nents, dir)
+#define dma_supported(dev, mask)                       \
+               pci_dma_supported(alpha_gendev_to_pci(dev), mask)
+#define dma_mapping_error(dev, addr)                           \
+               pci_dma_mapping_error(alpha_gendev_to_pci(dev), addr)
+
+#else  /* no PCI - no IOMMU. */
+
+struct scatterlist;
+void *dma_alloc_coherent(struct device *dev, size_t size,
+                        dma_addr_t *dma_handle, gfp_t gfp);
+int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
+              enum dma_data_direction direction);
+
+#define dma_free_coherent(dev, size, va, addr)         \
+               free_pages((unsigned long)va, get_order(size))
+#define dma_supported(dev, mask)               (mask < 0x00ffffffUL ? 0 : 1)
+#define dma_map_single(dev, va, size, dir)     virt_to_phys(va)
+#define dma_map_page(dev, page, off, size, dir)        (page_to_pa(page) + off)
+
+#define dma_unmap_single(dev, addr, size, dir) ((void)0)
+#define dma_unmap_page(dev, addr, size, dir)   ((void)0)
+#define dma_unmap_sg(dev, sg, nents, dir)      ((void)0)
+
+#define dma_mapping_error(dev, addr)  (0)
+
+#endif /* !CONFIG_PCI */
+
+#define dma_alloc_noncoherent(d, s, h, f)      dma_alloc_coherent(d, s, h, f)
+#define dma_free_noncoherent(d, s, v, h)       dma_free_coherent(d, s, v, h)
+#define dma_is_consistent(d, h)                        (1)
+
+int dma_set_mask(struct device *dev, u64 mask);
+
+#define dma_sync_single_for_cpu(dev, addr, size, dir)    ((void)0)
+#define dma_sync_single_for_device(dev, addr, size, dir)  ((void)0)
+#define dma_sync_single_range(dev, addr, off, size, dir)  ((void)0)
+#define dma_sync_sg_for_cpu(dev, sg, nents, dir)         ((void)0)
+#define dma_sync_sg_for_device(dev, sg, nents, dir)      ((void)0)
+#define dma_cache_sync(dev, va, size, dir)               ((void)0)
+#define dma_sync_single_range_for_cpu(dev, addr, offset, size, dir)    ((void)0)
+#define dma_sync_single_range_for_device(dev, addr, offset, size, dir) ((void)0)
+
+#define dma_get_cache_alignment()                        L1_CACHE_BYTES
+
+#endif /* _ALPHA_DMA_MAPPING_H */
diff --git a/arch/alpha/include/asm/dma.h b/arch/alpha/include/asm/dma.h
new file mode 100644 (file)
index 0000000..87cfdbd
--- /dev/null
@@ -0,0 +1,376 @@
+/*
+ * include/asm-alpha/dma.h
+ *
+ * This is essentially the same as the i386 DMA stuff, as the AlphaPCs
+ * use ISA-compatible dma.  The only extension is support for high-page
+ * registers that allow to set the top 8 bits of a 32-bit DMA address.
+ * This register should be written last when setting up a DMA address
+ * as this will also enable DMA across 64 KB boundaries.
+ */
+
+/* $Id: dma.h,v 1.7 1992/12/14 00:29:34 root Exp root $
+ * linux/include/asm/dma.h: Defines for using and allocating dma channels.
+ * Written by Hennus Bergman, 1992.
+ * High DMA channel support & info by Hannu Savolainen
+ * and John Boyd, Nov. 1992.
+ */
+
+#ifndef _ASM_DMA_H
+#define _ASM_DMA_H
+
+#include <linux/spinlock.h>
+#include <asm/io.h>
+
+#define dma_outb       outb
+#define dma_inb                inb
+
+/*
+ * NOTES about DMA transfers:
+ *
+ *  controller 1: channels 0-3, byte operations, ports 00-1F
+ *  controller 2: channels 4-7, word operations, ports C0-DF
+ *
+ *  - ALL registers are 8 bits only, regardless of transfer size
+ *  - channel 4 is not used - cascades 1 into 2.
+ *  - channels 0-3 are byte - addresses/counts are for physical bytes
+ *  - channels 5-7 are word - addresses/counts are for physical words
+ *  - transfers must not cross physical 64K (0-3) or 128K (5-7) boundaries
+ *  - transfer count loaded to registers is 1 less than actual count
+ *  - controller 2 offsets are all even (2x offsets for controller 1)
+ *  - page registers for 5-7 don't use data bit 0, represent 128K pages
+ *  - page registers for 0-3 use bit 0, represent 64K pages
+ *
+ * DMA transfers are limited to the lower 16MB of _physical_ memory.  
+ * Note that addresses loaded into registers must be _physical_ addresses,
+ * not logical addresses (which may differ if paging is active).
+ *
+ *  Address mapping for channels 0-3:
+ *
+ *   A23 ... A16 A15 ... A8  A7 ... A0    (Physical addresses)
+ *    |  ...  |   |  ... |   |  ... |
+ *    |  ...  |   |  ... |   |  ... |
+ *    |  ...  |   |  ... |   |  ... |
+ *   P7  ...  P0  A7 ... A0  A7 ... A0   
+ * |    Page    | Addr MSB | Addr LSB |   (DMA registers)
+ *
+ *  Address mapping for channels 5-7:
+ *
+ *   A23 ... A17 A16 A15 ... A9 A8 A7 ... A1 A0    (Physical addresses)
+ *    |  ...  |   \   \   ... \  \  \  ... \  \
+ *    |  ...  |    \   \   ... \  \  \  ... \  (not used)
+ *    |  ...  |     \   \   ... \  \  \  ... \
+ *   P7  ...  P1 (0) A7 A6  ... A0 A7 A6 ... A0   
+ * |      Page      |  Addr MSB   |  Addr LSB  |   (DMA registers)
+ *
+ * Again, channels 5-7 transfer _physical_ words (16 bits), so addresses
+ * and counts _must_ be word-aligned (the lowest address bit is _ignored_ at
+ * the hardware level, so odd-byte transfers aren't possible).
+ *
+ * Transfer count (_not # bytes_) is limited to 64K, represented as actual
+ * count - 1 : 64K => 0xFFFF, 1 => 0x0000.  Thus, count is always 1 or more,
+ * and up to 128K bytes may be transferred on channels 5-7 in one operation. 
+ *
+ */
+
+#define MAX_DMA_CHANNELS       8
+
+/*
+  ISA DMA limitations on Alpha platforms,
+
+  These may be due to SIO (PCI<->ISA bridge) chipset limitation, or
+  just a wiring limit.
+*/
+
+/* The maximum address for ISA DMA transfer on Alpha XL, due to an
+   hardware SIO limitation, is 64MB.
+*/
+#define ALPHA_XL_MAX_ISA_DMA_ADDRESS           0x04000000UL
+
+/* The maximum address for ISA DMA transfer on RUFFIAN,
+   due to an hardware SIO limitation, is 16MB.
+*/
+#define ALPHA_RUFFIAN_MAX_ISA_DMA_ADDRESS      0x01000000UL
+
+/* The maximum address for ISA DMA transfer on SABLE, and some ALCORs,
+   due to an hardware SIO chip limitation, is 2GB.
+*/
+#define ALPHA_SABLE_MAX_ISA_DMA_ADDRESS                0x80000000UL
+#define ALPHA_ALCOR_MAX_ISA_DMA_ADDRESS                0x80000000UL
+
+/*
+  Maximum address for all the others is the complete 32-bit bus
+  address space.
+*/
+#define ALPHA_MAX_ISA_DMA_ADDRESS              0x100000000UL
+
+#ifdef CONFIG_ALPHA_GENERIC
+# define MAX_ISA_DMA_ADDRESS           (alpha_mv.max_isa_dma_address)
+#else
+# if defined(CONFIG_ALPHA_XL)
+#  define MAX_ISA_DMA_ADDRESS          ALPHA_XL_MAX_ISA_DMA_ADDRESS
+# elif defined(CONFIG_ALPHA_RUFFIAN)
+#  define MAX_ISA_DMA_ADDRESS          ALPHA_RUFFIAN_MAX_ISA_DMA_ADDRESS
+# elif defined(CONFIG_ALPHA_SABLE)
+#  define MAX_ISA_DMA_ADDRESS          ALPHA_SABLE_MAX_ISA_DMA_ADDRESS
+# elif defined(CONFIG_ALPHA_ALCOR)
+#  define MAX_ISA_DMA_ADDRESS          ALPHA_ALCOR_MAX_ISA_DMA_ADDRESS
+# else
+#  define MAX_ISA_DMA_ADDRESS          ALPHA_MAX_ISA_DMA_ADDRESS
+# endif
+#endif
+
+/* If we have the iommu, we don't have any address limitations on DMA.
+   Otherwise (Nautilus, RX164), we have to have 0-16 Mb DMA zone
+   like i386. */
+#define MAX_DMA_ADDRESS                (alpha_mv.mv_pci_tbi ?  \
+                                ~0UL : IDENT_ADDR + 0x01000000)
+
+/* 8237 DMA controllers */
+#define IO_DMA1_BASE   0x00    /* 8 bit slave DMA, channels 0..3 */
+#define IO_DMA2_BASE   0xC0    /* 16 bit master DMA, ch 4(=slave input)..7 */
+
+/* DMA controller registers */
+#define DMA1_CMD_REG           0x08    /* command register (w) */
+#define DMA1_STAT_REG          0x08    /* status register (r) */
+#define DMA1_REQ_REG            0x09    /* request register (w) */
+#define DMA1_MASK_REG          0x0A    /* single-channel mask (w) */
+#define DMA1_MODE_REG          0x0B    /* mode register (w) */
+#define DMA1_CLEAR_FF_REG      0x0C    /* clear pointer flip-flop (w) */
+#define DMA1_TEMP_REG           0x0D    /* Temporary Register (r) */
+#define DMA1_RESET_REG         0x0D    /* Master Clear (w) */
+#define DMA1_CLR_MASK_REG       0x0E    /* Clear Mask */
+#define DMA1_MASK_ALL_REG       0x0F    /* all-channels mask (w) */
+#define DMA1_EXT_MODE_REG      (0x400 | DMA1_MODE_REG)
+
+#define DMA2_CMD_REG           0xD0    /* command register (w) */
+#define DMA2_STAT_REG          0xD0    /* status register (r) */
+#define DMA2_REQ_REG            0xD2    /* request register (w) */
+#define DMA2_MASK_REG          0xD4    /* single-channel mask (w) */
+#define DMA2_MODE_REG          0xD6    /* mode register (w) */
+#define DMA2_CLEAR_FF_REG      0xD8    /* clear pointer flip-flop (w) */
+#define DMA2_TEMP_REG           0xDA    /* Temporary Register (r) */
+#define DMA2_RESET_REG         0xDA    /* Master Clear (w) */
+#define DMA2_CLR_MASK_REG       0xDC    /* Clear Mask */
+#define DMA2_MASK_ALL_REG       0xDE    /* all-channels mask (w) */
+#define DMA2_EXT_MODE_REG      (0x400 | DMA2_MODE_REG)
+
+#define DMA_ADDR_0              0x00    /* DMA address registers */
+#define DMA_ADDR_1              0x02
+#define DMA_ADDR_2              0x04
+#define DMA_ADDR_3              0x06
+#define DMA_ADDR_4              0xC0
+#define DMA_ADDR_5              0xC4
+#define DMA_ADDR_6              0xC8
+#define DMA_ADDR_7              0xCC
+
+#define DMA_CNT_0               0x01    /* DMA count registers */
+#define DMA_CNT_1               0x03
+#define DMA_CNT_2               0x05
+#define DMA_CNT_3               0x07
+#define DMA_CNT_4               0xC2
+#define DMA_CNT_5               0xC6
+#define DMA_CNT_6               0xCA
+#define DMA_CNT_7               0xCE
+
+#define DMA_PAGE_0              0x87    /* DMA page registers */
+#define DMA_PAGE_1              0x83
+#define DMA_PAGE_2              0x81
+#define DMA_PAGE_3              0x82
+#define DMA_PAGE_5              0x8B
+#define DMA_PAGE_6              0x89
+#define DMA_PAGE_7              0x8A
+
+#define DMA_HIPAGE_0           (0x400 | DMA_PAGE_0)
+#define DMA_HIPAGE_1           (0x400 | DMA_PAGE_1)
+#define DMA_HIPAGE_2           (0x400 | DMA_PAGE_2)
+#define DMA_HIPAGE_3           (0x400 | DMA_PAGE_3)
+#define DMA_HIPAGE_4           (0x400 | DMA_PAGE_4)
+#define DMA_HIPAGE_5           (0x400 | DMA_PAGE_5)
+#define DMA_HIPAGE_6           (0x400 | DMA_PAGE_6)
+#define DMA_HIPAGE_7           (0x400 | DMA_PAGE_7)
+
+#define DMA_MODE_READ  0x44    /* I/O to memory, no autoinit, increment, single mode */
+#define DMA_MODE_WRITE 0x48    /* memory to I/O, no autoinit, increment, single mode */
+#define DMA_MODE_CASCADE 0xC0   /* pass thru DREQ->HRQ, DACK<-HLDA only */
+
+#define DMA_AUTOINIT   0x10
+
+extern spinlock_t  dma_spin_lock;
+
+static __inline__ unsigned long claim_dma_lock(void)
+{
+       unsigned long flags;
+       spin_lock_irqsave(&dma_spin_lock, flags);
+       return flags;
+}
+
+static __inline__ void release_dma_lock(unsigned long flags)
+{
+       spin_unlock_irqrestore(&dma_spin_lock, flags);
+}
+
+/* enable/disable a specific DMA channel */
+static __inline__ void enable_dma(unsigned int dmanr)
+{
+       if (dmanr<=3)
+               dma_outb(dmanr,  DMA1_MASK_REG);
+       else
+               dma_outb(dmanr & 3,  DMA2_MASK_REG);
+}
+
+static __inline__ void disable_dma(unsigned int dmanr)
+{
+       if (dmanr<=3)
+               dma_outb(dmanr | 4,  DMA1_MASK_REG);
+       else
+               dma_outb((dmanr & 3) | 4,  DMA2_MASK_REG);
+}
+
+/* Clear the 'DMA Pointer Flip Flop'.
+ * Write 0 for LSB/MSB, 1 for MSB/LSB access.
+ * Use this once to initialize the FF to a known state.
+ * After that, keep track of it. :-)
+ * --- In order to do that, the DMA routines below should ---
+ * --- only be used while interrupts are disabled! ---
+ */
+static __inline__ void clear_dma_ff(unsigned int dmanr)
+{
+       if (dmanr<=3)
+               dma_outb(0,  DMA1_CLEAR_FF_REG);
+       else
+               dma_outb(0,  DMA2_CLEAR_FF_REG);
+}
+
+/* set mode (above) for a specific DMA channel */
+static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
+{
+       if (dmanr<=3)
+               dma_outb(mode | dmanr,  DMA1_MODE_REG);
+       else
+               dma_outb(mode | (dmanr&3),  DMA2_MODE_REG);
+}
+
+/* set extended mode for a specific DMA channel */
+static __inline__ void set_dma_ext_mode(unsigned int dmanr, char ext_mode)
+{
+       if (dmanr<=3)
+               dma_outb(ext_mode | dmanr,  DMA1_EXT_MODE_REG);
+       else
+               dma_outb(ext_mode | (dmanr&3),  DMA2_EXT_MODE_REG);
+}
+
+/* Set only the page register bits of the transfer address.
+ * This is used for successive transfers when we know the contents of
+ * the lower 16 bits of the DMA current address register.
+ */
+static __inline__ void set_dma_page(unsigned int dmanr, unsigned int pagenr)
+{
+       switch(dmanr) {
+               case 0:
+                       dma_outb(pagenr, DMA_PAGE_0);
+                       dma_outb((pagenr >> 8), DMA_HIPAGE_0);
+                       break;
+               case 1:
+                       dma_outb(pagenr, DMA_PAGE_1);
+                       dma_outb((pagenr >> 8), DMA_HIPAGE_1);
+                       break;
+               case 2:
+                       dma_outb(pagenr, DMA_PAGE_2);
+                       dma_outb((pagenr >> 8), DMA_HIPAGE_2);
+                       break;
+               case 3:
+                       dma_outb(pagenr, DMA_PAGE_3);
+                       dma_outb((pagenr >> 8), DMA_HIPAGE_3);
+                       break;
+               case 5:
+                       dma_outb(pagenr & 0xfe, DMA_PAGE_5);
+                       dma_outb((pagenr >> 8), DMA_HIPAGE_5);
+                       break;
+               case 6:
+                       dma_outb(pagenr & 0xfe, DMA_PAGE_6);
+                       dma_outb((pagenr >> 8), DMA_HIPAGE_6);
+                       break;
+               case 7:
+                       dma_outb(pagenr & 0xfe, DMA_PAGE_7);
+                       dma_outb((pagenr >> 8), DMA_HIPAGE_7);
+                       break;
+       }
+}
+
+
+/* Set transfer address & page bits for specific DMA channel.
+ * Assumes dma flipflop is clear.
+ */
+static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
+{
+       if (dmanr <= 3)  {
+           dma_outb( a & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE );
+            dma_outb( (a>>8) & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE );
+       }  else  {
+           dma_outb( (a>>1) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE );
+           dma_outb( (a>>9) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE );
+       }
+       set_dma_page(dmanr, a>>16);     /* set hipage last to enable 32-bit mode */
+}
+
+
+/* Set transfer size (max 64k for DMA1..3, 128k for DMA5..7) for
+ * a specific DMA channel.
+ * You must ensure the parameters are valid.
+ * NOTE: from a manual: "the number of transfers is one more
+ * than the initial word count"! This is taken into account.
+ * Assumes dma flip-flop is clear.
+ * NOTE 2: "count" represents _bytes_ and must be even for channels 5-7.
+ */
+static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
+{
+        count--;
+       if (dmanr <= 3)  {
+           dma_outb( count & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE );
+           dma_outb( (count>>8) & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE );
+        } else {
+           dma_outb( (count>>1) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE );
+           dma_outb( (count>>9) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE );
+        }
+}
+
+
+/* Get DMA residue count. After a DMA transfer, this
+ * should return zero. Reading this while a DMA transfer is
+ * still in progress will return unpredictable results.
+ * If called before the channel has been used, it may return 1.
+ * Otherwise, it returns the number of _bytes_ left to transfer.
+ *
+ * Assumes DMA flip-flop is clear.
+ */
+static __inline__ int get_dma_residue(unsigned int dmanr)
+{
+       unsigned int io_port = (dmanr<=3)? ((dmanr&3)<<1) + 1 + IO_DMA1_BASE
+                                        : ((dmanr&3)<<2) + 2 + IO_DMA2_BASE;
+
+       /* using short to get 16-bit wrap around */
+       unsigned short count;
+
+       count = 1 + dma_inb(io_port);
+       count += dma_inb(io_port) << 8;
+       
+       return (dmanr<=3)? count : (count<<1);
+}
+
+
+/* These are in kernel/dma.c: */
+extern int request_dma(unsigned int dmanr, const char * device_id);    /* reserve a DMA channel */
+extern void free_dma(unsigned int dmanr);      /* release it again */
+#define KERNEL_HAVE_CHECK_DMA
+extern int check_dma(unsigned int dmanr);
+
+/* From PCI */
+
+#ifdef CONFIG_PCI
+extern int isa_dma_bridge_buggy;
+#else
+#define isa_dma_bridge_buggy   (0)
+#endif
+
+
+#endif /* _ASM_DMA_H */
diff --git a/arch/alpha/include/asm/elf.h b/arch/alpha/include/asm/elf.h
new file mode 100644 (file)
index 0000000..fc1002e
--- /dev/null
@@ -0,0 +1,165 @@
+#ifndef __ASM_ALPHA_ELF_H
+#define __ASM_ALPHA_ELF_H
+
+#include <asm/auxvec.h>
+
+/* Special values for the st_other field in the symbol table.  */
+
+#define STO_ALPHA_NOPV         0x80
+#define STO_ALPHA_STD_GPLOAD   0x88
+
+/*
+ * Alpha ELF relocation types
+ */
+#define R_ALPHA_NONE            0       /* No reloc */
+#define R_ALPHA_REFLONG         1       /* Direct 32 bit */
+#define R_ALPHA_REFQUAD         2       /* Direct 64 bit */
+#define R_ALPHA_GPREL32         3       /* GP relative 32 bit */
+#define R_ALPHA_LITERAL         4       /* GP relative 16 bit w/optimization */
+#define R_ALPHA_LITUSE          5       /* Optimization hint for LITERAL */
+#define R_ALPHA_GPDISP          6       /* Add displacement to GP */
+#define R_ALPHA_BRADDR          7       /* PC+4 relative 23 bit shifted */
+#define R_ALPHA_HINT            8       /* PC+4 relative 16 bit shifted */
+#define R_ALPHA_SREL16          9       /* PC relative 16 bit */
+#define R_ALPHA_SREL32          10      /* PC relative 32 bit */
+#define R_ALPHA_SREL64          11      /* PC relative 64 bit */
+#define R_ALPHA_GPRELHIGH       17      /* GP relative 32 bit, high 16 bits */
+#define R_ALPHA_GPRELLOW        18      /* GP relative 32 bit, low 16 bits */
+#define R_ALPHA_GPREL16         19      /* GP relative 16 bit */
+#define R_ALPHA_COPY            24      /* Copy symbol at runtime */
+#define R_ALPHA_GLOB_DAT        25      /* Create GOT entry */
+#define R_ALPHA_JMP_SLOT        26      /* Create PLT entry */
+#define R_ALPHA_RELATIVE        27      /* Adjust by program base */
+#define R_ALPHA_BRSGP          28
+#define R_ALPHA_TLSGD           29
+#define R_ALPHA_TLS_LDM         30
+#define R_ALPHA_DTPMOD64        31
+#define R_ALPHA_GOTDTPREL       32
+#define R_ALPHA_DTPREL64        33
+#define R_ALPHA_DTPRELHI        34
+#define R_ALPHA_DTPRELLO        35
+#define R_ALPHA_DTPREL16        36
+#define R_ALPHA_GOTTPREL        37
+#define R_ALPHA_TPREL64         38
+#define R_ALPHA_TPRELHI         39
+#define R_ALPHA_TPRELLO         40
+#define R_ALPHA_TPREL16         41
+
+#define SHF_ALPHA_GPREL                0x10000000
+
+/* Legal values for e_flags field of Elf64_Ehdr.  */
+
+#define EF_ALPHA_32BIT         1       /* All addresses are below 2GB */
+
+/*
+ * ELF register definitions..
+ */
+
+/*
+ * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
+ * I have no idea why that is so.  For now, we just leave it at 33
+ * (32 general regs + processor status word). 
+ */
+#define ELF_NGREG      33
+#define ELF_NFPREG     32
+
+typedef unsigned long elf_greg_t;
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef double elf_fpreg_t;
+typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+/*
+ * This is used to ensure we don't load something for the wrong architecture.
+ */
+#define elf_check_arch(x) ((x)->e_machine == EM_ALPHA)
+
+/*
+ * These are used to set parameters in the core dumps.
+ */
+#define ELF_CLASS      ELFCLASS64
+#define ELF_DATA       ELFDATA2LSB
+#define ELF_ARCH       EM_ALPHA
+
+#define USE_ELF_CORE_DUMP
+#define ELF_EXEC_PAGESIZE      8192
+
+/* This is the location that an ET_DYN program is loaded if exec'ed.  Typical
+   use of this is to invoke "./ld.so someprog" to test out a new version of
+   the loader.  We need to make sure that it is out of the way of the program
+   that it will "exec", and that there is sufficient room for the brk.  */
+
+#define ELF_ET_DYN_BASE                (TASK_UNMAPPED_BASE + 0x1000000)
+
+/* $0 is set by ld.so to a pointer to a function which might be 
+   registered using atexit.  This provides a mean for the dynamic
+   linker to call DT_FINI functions for shared libraries that have
+   been loaded before the code runs.
+
+   So that we can use the same startup file with static executables,
+   we start programs with a value of 0 to indicate that there is no
+   such function.  */
+
+#define ELF_PLAT_INIT(_r, load_addr)   _r->r0 = 0
+
+/* The registers are layed out in pt_regs for PAL and syscall
+   convenience.  Re-order them for the linear elf_gregset_t.  */
+
+struct pt_regs;
+struct thread_info;
+struct task_struct;
+extern void dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt,
+                           struct thread_info *ti);
+#define ELF_CORE_COPY_REGS(DEST, REGS) \
+       dump_elf_thread(DEST, REGS, current_thread_info());
+
+/* Similar, but for a thread other than current.  */
+
+extern int dump_elf_task(elf_greg_t *dest, struct task_struct *task);
+#define ELF_CORE_COPY_TASK_REGS(TASK, DEST) \
+       dump_elf_task(*(DEST), TASK)
+
+/* Similar, but for the FP registers.  */
+
+extern int dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task);
+#define ELF_CORE_COPY_FPREGS(TASK, DEST) \
+       dump_elf_task_fp(*(DEST), TASK)
+
+/* This yields a mask that user programs can use to figure out what
+   instruction set this CPU supports.  This is trivial on Alpha, 
+   but not so on other machines. */
+
+#define ELF_HWCAP  (~amask(-1))
+
+/* This yields a string that ld.so will use to load implementation
+   specific libraries for optimization.  This is more specific in
+   intent than poking at uname or /proc/cpuinfo.  */
+
+#define ELF_PLATFORM                           \
+({                                             \
+       enum implver_enum i_ = implver();       \
+       ( i_ == IMPLVER_EV4 ? "ev4"             \
+       : i_ == IMPLVER_EV5                     \
+         ? (amask(AMASK_BWX) ? "ev5" : "ev56") \
+       : amask (AMASK_CIX) ? "ev6" : "ev67");  \
+})
+
+#define SET_PERSONALITY(EX, IBCS2)                             \
+       set_personality(((EX).e_flags & EF_ALPHA_32BIT)         \
+          ? PER_LINUX_32BIT : (IBCS2) ? PER_SVR4 : PER_LINUX)
+
+extern int alpha_l1i_cacheshape;
+extern int alpha_l1d_cacheshape;
+extern int alpha_l2_cacheshape;
+extern int alpha_l3_cacheshape;
+
+/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
+#define ARCH_DLINFO                                            \
+  do {                                                         \
+    NEW_AUX_ENT(AT_L1I_CACHESHAPE, alpha_l1i_cacheshape);      \
+    NEW_AUX_ENT(AT_L1D_CACHESHAPE, alpha_l1d_cacheshape);      \
+    NEW_AUX_ENT(AT_L2_CACHESHAPE, alpha_l2_cacheshape);                \
+    NEW_AUX_ENT(AT_L3_CACHESHAPE, alpha_l3_cacheshape);                \
+  } while (0)
+
+#endif /* __ASM_ALPHA_ELF_H */
diff --git a/arch/alpha/include/asm/emergency-restart.h b/arch/alpha/include/asm/emergency-restart.h
new file mode 100644 (file)
index 0000000..108d8c4
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _ASM_EMERGENCY_RESTART_H
+#define _ASM_EMERGENCY_RESTART_H
+
+#include <asm-generic/emergency-restart.h>
+
+#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/arch/alpha/include/asm/err_common.h b/arch/alpha/include/asm/err_common.h
new file mode 100644 (file)
index 0000000..c250959
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ *     linux/include/asm-alpha/err_common.h
+ *
+ *     Copyright (C) 2000 Jeff Wiedemeier (Compaq Computer Corporation)
+ *
+ *     Contains declarations and macros to support Alpha error handling
+ *     implementations.
+ */
+
+#ifndef __ALPHA_ERR_COMMON_H
+#define __ALPHA_ERR_COMMON_H 1
+
+/*
+ * SCB Vector definitions
+ */
+#define SCB_Q_SYSERR   0x620
+#define SCB_Q_PROCERR  0x630
+#define SCB_Q_SYSMCHK  0x660
+#define SCB_Q_PROCMCHK 0x670
+#define SCB_Q_SYSEVENT 0x680
+
+/*
+ * Disposition definitions for logout frame parser
+ */
+#define MCHK_DISPOSITION_UNKNOWN_ERROR         0x00
+#define MCHK_DISPOSITION_REPORT                        0x01
+#define MCHK_DISPOSITION_DISMISS               0x02
+
+/*
+ * Error Log definitions
+ */
+/*
+ * Types
+ */
+
+#define EL_CLASS__TERMINATION          (0)
+#  define EL_TYPE__TERMINATION__TERMINATION            (0)
+#define EL_CLASS__HEADER               (5)
+#  define EL_TYPE__HEADER__SYSTEM_ERROR_FRAME          (1)
+#  define EL_TYPE__HEADER__SYSTEM_EVENT_FRAME          (2)
+#  define EL_TYPE__HEADER__HALT_FRAME                  (3)
+#  define EL_TYPE__HEADER__LOGOUT_FRAME                        (19)
+#define EL_CLASS__GENERAL_NOTIFICATION (9)
+#define EL_CLASS__PCI_ERROR_FRAME      (11)
+#define EL_CLASS__REGATTA_FAMILY       (12)
+#  define EL_TYPE__REGATTA__PROCESSOR_ERROR_FRAME      (1)
+#  define EL_TYPE__REGATTA__SYSTEM_ERROR_FRAME         (2)
+#  define EL_TYPE__REGATTA__ENVIRONMENTAL_FRAME                (3)
+#  define EL_TYPE__REGATTA__TITAN_PCHIP0_EXTENDED      (8)
+#  define EL_TYPE__REGATTA__TITAN_PCHIP1_EXTENDED      (9)
+#  define EL_TYPE__REGATTA__TITAN_MEMORY_EXTENDED      (10)
+#  define EL_TYPE__REGATTA__PROCESSOR_DBL_ERROR_HALT   (11)
+#  define EL_TYPE__REGATTA__SYSTEM_DBL_ERROR_HALT      (12)
+#define EL_CLASS__PAL                   (14)
+#  define EL_TYPE__PAL__LOGOUT_FRAME                    (1)
+#  define EL_TYPE__PAL__EV7_PROCESSOR                  (4)
+#  define EL_TYPE__PAL__EV7_ZBOX                       (5)
+#  define EL_TYPE__PAL__EV7_RBOX                       (6)
+#  define EL_TYPE__PAL__EV7_IO                         (7)
+#  define EL_TYPE__PAL__ENV__AMBIENT_TEMPERATURE       (10)
+#  define EL_TYPE__PAL__ENV__AIRMOVER_FAN              (11)
+#  define EL_TYPE__PAL__ENV__VOLTAGE                   (12)
+#  define EL_TYPE__PAL__ENV__INTRUSION                 (13)
+#  define EL_TYPE__PAL__ENV__POWER_SUPPLY              (14)
+#  define EL_TYPE__PAL__ENV__LAN                       (15)
+#  define EL_TYPE__PAL__ENV__HOT_PLUG                  (16)
+
+union el_timestamp {
+       struct {
+               u8 second;
+               u8 minute;
+               u8 hour;
+               u8 day;
+               u8 month;
+               u8 year;
+       } b;
+       u64 as_int;
+};
+
+struct el_subpacket {
+       u16 length;             /* length of header (in bytes)  */
+       u16 class;              /* header class and type...     */
+       u16 type;               /* ...determine content         */
+       u16 revision;           /* header revision              */
+       union {
+               struct {        /* Class 5, Type 1 - System Error       */
+                       u32 frame_length;
+                       u32 frame_packet_count;                 
+               } sys_err;                      
+               struct {        /* Class 5, Type 2 - System Event       */
+                       union el_timestamp timestamp;
+                       u32 frame_length;
+                       u32 frame_packet_count;                 
+               } sys_event;
+               struct {        /* Class 5, Type 3 - Double Error Halt  */
+                       u16 halt_code;
+                       u16 reserved;
+                       union el_timestamp timestamp;
+                       u32 frame_length;
+                       u32 frame_packet_count;
+               } err_halt;
+               struct {        /* Clasee 5, Type 19 - Logout Frame Header */
+                       u32 frame_length;
+                       u32 frame_flags;
+                       u32 cpu_offset; 
+                       u32 system_offset;
+               } logout_header;
+               struct {        /* Class 12 - Regatta                   */
+                       u64 cpuid;
+                       u64 data_start[1];
+               } regatta_frame;
+               struct {        /* Raw                                  */
+                       u64 data_start[1];
+               } raw;
+       } by_type;
+};
+
+#endif /* __ALPHA_ERR_COMMON_H */
diff --git a/arch/alpha/include/asm/err_ev6.h b/arch/alpha/include/asm/err_ev6.h
new file mode 100644 (file)
index 0000000..ea63779
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ALPHA_ERR_EV6_H
+#define __ALPHA_ERR_EV6_H 1
+
+/* Dummy include for now. */
+
+#endif /* __ALPHA_ERR_EV6_H */
diff --git a/arch/alpha/include/asm/err_ev7.h b/arch/alpha/include/asm/err_ev7.h
new file mode 100644 (file)
index 0000000..87f9977
--- /dev/null
@@ -0,0 +1,202 @@
+#ifndef __ALPHA_ERR_EV7_H
+#define __ALPHA_ERR_EV7_H 1
+
+/*
+ * Data for el packet class PAL (14), type LOGOUT_FRAME (1)
+ */
+struct ev7_pal_logout_subpacket {
+       u32 mchk_code;
+       u32 subpacket_count;
+       u64 whami;
+       u64 rbox_whami;
+       u64 rbox_int;
+       u64 exc_addr;
+       union el_timestamp timestamp;
+       u64 halt_code;
+       u64 reserved;
+};
+
+/*
+ * Data for el packet class PAL (14), type EV7_PROCESSOR (4)
+ */
+struct ev7_pal_processor_subpacket {
+       u64 i_stat;
+       u64 dc_stat;
+       u64 c_addr;
+       u64 c_syndrome_1;
+       u64 c_syndrome_0;
+       u64 c_stat;
+       u64 c_sts;
+       u64 mm_stat;
+       u64 exc_addr;
+       u64 ier_cm;
+       u64 isum;
+       u64 pal_base;
+       u64 i_ctl;
+       u64 process_context;
+       u64 cbox_ctl;
+       u64 cbox_stp_ctl;
+       u64 cbox_acc_ctl;
+       u64 cbox_lcl_set;
+       u64 cbox_gbl_set;
+       u64 bbox_ctl;
+       u64 bbox_err_sts;
+       u64 bbox_err_idx;
+       u64 cbox_ddp_err_sts;
+       u64 bbox_dat_rmp;
+       u64 reserved[2];
+};
+
+/*
+ * Data for el packet class PAL (14), type EV7_ZBOX (5)
+ */
+struct ev7_pal_zbox_subpacket {
+       u32 zbox0_dram_err_status_1;
+       u32 zbox0_dram_err_status_2;
+       u32 zbox0_dram_err_status_3;
+       u32 zbox0_dram_err_ctl;
+       u32 zbox0_dram_err_adr;
+       u32 zbox0_dift_timeout;
+       u32 zbox0_dram_mapper_ctl;
+       u32 zbox0_frc_err_adr;
+       u32 zbox0_dift_err_status;
+       u32 reserved1;
+       u32 zbox1_dram_err_status_1;
+       u32 zbox1_dram_err_status_2;
+       u32 zbox1_dram_err_status_3;
+       u32 zbox1_dram_err_ctl;
+       u32 zbox1_dram_err_adr;
+       u32 zbox1_dift_timeout;
+       u32 zbox1_dram_mapper_ctl;
+       u32 zbox1_frc_err_adr;
+       u32 zbox1_dift_err_status;
+       u32 reserved2;
+       u64 cbox_ctl;
+       u64 cbox_stp_ctl;
+       u64 zbox0_error_pa;
+       u64 zbox1_error_pa;
+       u64 zbox0_ored_syndrome;
+       u64 zbox1_ored_syndrome;
+       u64 reserved3[2];
+};
+
+/*
+ * Data for el packet class PAL (14), type EV7_RBOX (6)
+ */
+struct ev7_pal_rbox_subpacket {
+       u64 rbox_cfg;
+       u64 rbox_n_cfg;
+       u64 rbox_s_cfg;
+       u64 rbox_e_cfg;
+       u64 rbox_w_cfg;
+       u64 rbox_n_err;
+       u64 rbox_s_err;
+       u64 rbox_e_err;
+       u64 rbox_w_err;
+       u64 rbox_io_cfg;
+       u64 rbox_io_err;
+       u64 rbox_l_err;
+       u64 rbox_whoami;
+       u64 rbox_imask;
+       u64 rbox_intq;
+       u64 rbox_int;
+       u64 reserved[2];
+};
+
+/*
+ * Data for el packet class PAL (14), type EV7_IO (7)
+ */
+struct ev7_pal_io_one_port {
+       u64 pox_err_sum;
+       u64 pox_tlb_err;
+       u64 pox_spl_cmplt;
+       u64 pox_trans_sum;
+       u64 pox_first_err;
+       u64 pox_mult_err;
+       u64 pox_dm_source;
+       u64 pox_dm_dest;
+       u64 pox_dm_size;
+       u64 pox_dm_ctrl;
+       u64 reserved;
+};
+
+struct ev7_pal_io_subpacket {
+       u64 io_asic_rev;
+       u64 io_sys_rev;
+       u64 io7_uph;
+       u64 hpi_ctl;
+       u64 crd_ctl;
+       u64 hei_ctl;
+       u64 po7_error_sum;
+       u64 po7_uncrr_sym;
+       u64 po7_crrct_sym;
+       u64 po7_ugbge_sym;
+       u64 po7_err_pkt0;
+       u64 po7_err_pkt1;
+       u64 reserved[2];
+       struct ev7_pal_io_one_port ports[4];
+};
+
+/*
+ * Environmental subpacket. Data used for el packets:
+ *        class PAL (14), type AMBIENT_TEMPERATURE (10)
+ *        class PAL (14), type AIRMOVER_FAN (11)
+ *        class PAL (14), type VOLTAGE (12)
+ *        class PAL (14), type INTRUSION (13)
+ *        class PAL (14), type POWER_SUPPLY (14)
+ *        class PAL (14), type LAN (15)
+ *        class PAL (14), type HOT_PLUG (16)
+ */
+struct ev7_pal_environmental_subpacket {
+       u16 cabinet;
+       u16 drawer;
+       u16 reserved1[2];
+       u8 module_type;
+       u8 unit_id;             /* unit reporting condition */
+       u8 reserved2;
+       u8 condition;           /* condition reported       */
+};
+
+/*
+ * Convert environmental type to index
+ */
+static inline int ev7_lf_env_index(int type)
+{
+       BUG_ON((type < EL_TYPE__PAL__ENV__AMBIENT_TEMPERATURE) 
+              || (type > EL_TYPE__PAL__ENV__HOT_PLUG));
+
+       return type - EL_TYPE__PAL__ENV__AMBIENT_TEMPERATURE;
+}
+
+/*
+ * Data for generic el packet class PAL.
+ */
+struct ev7_pal_subpacket {
+       union {
+               struct ev7_pal_logout_subpacket logout;      /* Type     1 */
+               struct ev7_pal_processor_subpacket ev7;      /* Type     4 */
+               struct ev7_pal_zbox_subpacket zbox;          /* Type     5 */
+               struct ev7_pal_rbox_subpacket rbox;          /* Type     6 */
+               struct ev7_pal_io_subpacket io;              /* Type     7 */
+               struct ev7_pal_environmental_subpacket env;  /* Type 10-16 */
+               u64 as_quad[1];                              /* Raw u64    */
+       } by_type;
+};
+
+/*
+ * Struct to contain collected logout from subpackets.
+ */
+struct ev7_lf_subpackets {
+       struct ev7_pal_logout_subpacket *logout;                /* Type  1 */
+       struct ev7_pal_processor_subpacket *ev7;                /* Type  4 */
+       struct ev7_pal_zbox_subpacket *zbox;                    /* Type  5 */
+       struct ev7_pal_rbox_subpacket *rbox;                    /* Type  6 */
+       struct ev7_pal_io_subpacket *io;                        /* Type  7 */
+       struct ev7_pal_environmental_subpacket *env[7];      /* Type 10-16 */
+
+       unsigned int io_pid;
+};
+
+#endif /* __ALPHA_ERR_EV7_H */
+
+
diff --git a/arch/alpha/include/asm/errno.h b/arch/alpha/include/asm/errno.h
new file mode 100644 (file)
index 0000000..69e2655
--- /dev/null
@@ -0,0 +1,123 @@
+#ifndef _ALPHA_ERRNO_H
+#define _ALPHA_ERRNO_H
+
+#include <asm-generic/errno-base.h>
+
+#undef EAGAIN                  /* 11 in errno-base.h */
+
+#define        EDEADLK         11      /* Resource deadlock would occur */
+
+#define        EAGAIN          35      /* Try again */
+#define        EWOULDBLOCK     EAGAIN  /* Operation would block */
+#define        EINPROGRESS     36      /* Operation now in progress */
+#define        EALREADY        37      /* Operation already in progress */
+#define        ENOTSOCK        38      /* Socket operation on non-socket */
+#define        EDESTADDRREQ    39      /* Destination address required */
+#define        EMSGSIZE        40      /* Message too long */
+#define        EPROTOTYPE      41      /* Protocol wrong type for socket */
+#define        ENOPROTOOPT     42      /* Protocol not available */
+#define        EPROTONOSUPPORT 43      /* Protocol not supported */
+#define        ESOCKTNOSUPPORT 44      /* Socket type not supported */
+#define        EOPNOTSUPP      45      /* Operation not supported on transport endpoint */
+#define        EPFNOSUPPORT    46      /* Protocol family not supported */
+#define        EAFNOSUPPORT    47      /* Address family not supported by protocol */
+#define        EADDRINUSE      48      /* Address already in use */
+#define        EADDRNOTAVAIL   49      /* Cannot assign requested address */
+#define        ENETDOWN        50      /* Network is down */
+#define        ENETUNREACH     51      /* Network is unreachable */
+#define        ENETRESET       52      /* Network dropped connection because of reset */
+#define        ECONNABORTED    53      /* Software caused connection abort */
+#define        ECONNRESET      54      /* Connection reset by peer */
+#define        ENOBUFS         55      /* No buffer space available */
+#define        EISCONN         56      /* Transport endpoint is already connected */
+#define        ENOTCONN        57      /* Transport endpoint is not connected */
+#define        ESHUTDOWN       58      /* Cannot send after transport endpoint shutdown */
+#define        ETOOMANYREFS    59      /* Too many references: cannot splice */
+#define        ETIMEDOUT       60      /* Connection timed out */
+#define        ECONNREFUSED    61      /* Connection refused */
+#define        ELOOP           62      /* Too many symbolic links encountered */
+#define        ENAMETOOLONG    63      /* File name too long */
+#define        EHOSTDOWN       64      /* Host is down */
+#define        EHOSTUNREACH    65      /* No route to host */
+#define        ENOTEMPTY       66      /* Directory not empty */
+
+#define        EUSERS          68      /* Too many users */
+#define        EDQUOT          69      /* Quota exceeded */
+#define        ESTALE          70      /* Stale NFS file handle */
+#define        EREMOTE         71      /* Object is remote */
+
+#define        ENOLCK          77      /* No record locks available */
+#define        ENOSYS          78      /* Function not implemented */
+
+#define        ENOMSG          80      /* No message of desired type */
+#define        EIDRM           81      /* Identifier removed */
+#define        ENOSR           82      /* Out of streams resources */
+#define        ETIME           83      /* Timer expired */
+#define        EBADMSG         84      /* Not a data message */
+#define        EPROTO          85      /* Protocol error */
+#define        ENODATA         86      /* No data available */
+#define        ENOSTR          87      /* Device not a stream */
+
+#define        ENOPKG          92      /* Package not installed */
+
+#define        EILSEQ          116     /* Illegal byte sequence */
+
+/* The following are just random noise.. */
+#define        ECHRNG          88      /* Channel number out of range */
+#define        EL2NSYNC        89      /* Level 2 not synchronized */
+#define        EL3HLT          90      /* Level 3 halted */
+#define        EL3RST          91      /* Level 3 reset */
+
+#define        ELNRNG          93      /* Link number out of range */
+#define        EUNATCH         94      /* Protocol driver not attached */
+#define        ENOCSI          95      /* No CSI structure available */
+#define        EL2HLT          96      /* Level 2 halted */
+#define        EBADE           97      /* Invalid exchange */
+#define        EBADR           98      /* Invalid request descriptor */
+#define        EXFULL          99      /* Exchange full */
+#define        ENOANO          100     /* No anode */
+#define        EBADRQC         101     /* Invalid request code */
+#define        EBADSLT         102     /* Invalid slot */
+
+#define        EDEADLOCK       EDEADLK
+
+#define        EBFONT          104     /* Bad font file format */
+#define        ENONET          105     /* Machine is not on the network */
+#define        ENOLINK         106     /* Link has been severed */
+#define        EADV            107     /* Advertise error */
+#define        ESRMNT          108     /* Srmount error */
+#define        ECOMM           109     /* Communication error on send */
+#define        EMULTIHOP       110     /* Multihop attempted */
+#define        EDOTDOT         111     /* RFS specific error */
+#define        EOVERFLOW       112     /* Value too large for defined data type */
+#define        ENOTUNIQ        113     /* Name not unique on network */
+#define        EBADFD          114     /* File descriptor in bad state */
+#define        EREMCHG         115     /* Remote address changed */
+
+#define        EUCLEAN         117     /* Structure needs cleaning */
+#define        ENOTNAM         118     /* Not a XENIX named type file */
+#define        ENAVAIL         119     /* No XENIX semaphores available */
+#define        EISNAM          120     /* Is a named type file */
+#define        EREMOTEIO       121     /* Remote I/O error */
+
+#define        ELIBACC         122     /* Can not access a needed shared library */
+#define        ELIBBAD         123     /* Accessing a corrupted shared library */
+#define        ELIBSCN         124     /* .lib section in a.out corrupted */
+#define        ELIBMAX         125     /* Attempting to link in too many shared libraries */
+#define        ELIBEXEC        126     /* Cannot exec a shared library directly */
+#define        ERESTART        127     /* Interrupted system call should be restarted */
+#define        ESTRPIPE        128     /* Streams pipe error */
+
+#define ENOMEDIUM      129     /* No medium found */
+#define EMEDIUMTYPE    130     /* Wrong medium type */
+#define        ECANCELED       131     /* Operation Cancelled */
+#define        ENOKEY          132     /* Required key not available */
+#define        EKEYEXPIRED     133     /* Key has expired */
+#define        EKEYREVOKED     134     /* Key has been revoked */
+#define        EKEYREJECTED    135     /* Key was rejected by service */
+
+/* for robust mutexes */
+#define        EOWNERDEAD      136     /* Owner died */
+#define        ENOTRECOVERABLE 137     /* State not recoverable */
+
+#endif
diff --git a/arch/alpha/include/asm/fb.h b/arch/alpha/include/asm/fb.h
new file mode 100644 (file)
index 0000000..fa9bbb9
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef _ASM_FB_H_
+#define _ASM_FB_H_
+#include <linux/device.h>
+
+/* Caching is off in the I/O space quadrant by design.  */
+#define fb_pgprotect(...) do {} while (0)
+
+static inline int fb_is_primary_device(struct fb_info *info)
+{
+       return 0;
+}
+
+#endif /* _ASM_FB_H_ */
diff --git a/arch/alpha/include/asm/fcntl.h b/arch/alpha/include/asm/fcntl.h
new file mode 100644 (file)
index 0000000..25da001
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef _ALPHA_FCNTL_H
+#define _ALPHA_FCNTL_H
+
+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
+   located on an ext2 file system */
+#define O_CREAT                 01000  /* not fcntl */
+#define O_TRUNC                 02000  /* not fcntl */
+#define O_EXCL          04000  /* not fcntl */
+#define O_NOCTTY       010000  /* not fcntl */
+
+#define O_NONBLOCK      00004
+#define O_APPEND        00010
+#define O_SYNC         040000
+#define O_DIRECTORY    0100000 /* must be a directory */
+#define O_NOFOLLOW     0200000 /* don't follow links */
+#define O_LARGEFILE    0400000 /* will be set by the kernel on every open */
+#define O_DIRECT       02000000 /* direct disk access - should check with OSF/1 */
+#define O_NOATIME      04000000
+#define O_CLOEXEC      010000000 /* set close_on_exec */
+
+#define F_GETLK                7
+#define F_SETLK                8
+#define F_SETLKW       9
+
+#define F_SETOWN       5       /*  for sockets. */
+#define F_GETOWN       6       /*  for sockets. */
+#define F_SETSIG       10      /*  for sockets. */
+#define F_GETSIG       11      /*  for sockets. */
+
+/* for posix fcntl() and lockf() */
+#define F_RDLCK                1
+#define F_WRLCK                2
+#define F_UNLCK                8
+
+/* for old implementation of bsd flock () */
+#define F_EXLCK                16      /* or 3 */
+#define F_SHLCK                32      /* or 4 */
+
+#define F_INPROGRESS   64
+
+#include <asm-generic/fcntl.h>
+
+#endif
diff --git a/arch/alpha/include/asm/floppy.h b/arch/alpha/include/asm/floppy.h
new file mode 100644 (file)
index 0000000..0be5041
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Architecture specific parts of the Floppy driver
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1995
+ */
+#ifndef __ASM_ALPHA_FLOPPY_H
+#define __ASM_ALPHA_FLOPPY_H
+
+
+#define fd_inb(port)                   inb_p(port)
+#define fd_outb(value,port)            outb_p(value,port)
+
+#define fd_enable_dma()         enable_dma(FLOPPY_DMA)
+#define fd_disable_dma()        disable_dma(FLOPPY_DMA)
+#define fd_request_dma()        request_dma(FLOPPY_DMA,"floppy")
+#define fd_free_dma()           free_dma(FLOPPY_DMA)
+#define fd_clear_dma_ff()       clear_dma_ff(FLOPPY_DMA)
+#define fd_set_dma_mode(mode)   set_dma_mode(FLOPPY_DMA,mode)
+#define fd_set_dma_addr(addr)   set_dma_addr(FLOPPY_DMA,virt_to_bus(addr))
+#define fd_set_dma_count(count) set_dma_count(FLOPPY_DMA,count)
+#define fd_enable_irq()         enable_irq(FLOPPY_IRQ)
+#define fd_disable_irq()        disable_irq(FLOPPY_IRQ)
+#define fd_cacheflush(addr,size) /* nothing */
+#define fd_request_irq()        request_irq(FLOPPY_IRQ, floppy_interrupt,\
+                                           IRQF_DISABLED, "floppy", NULL)
+#define fd_free_irq()           free_irq(FLOPPY_IRQ, NULL);
+
+#ifdef CONFIG_PCI
+
+#include <linux/pci.h>
+
+#define fd_dma_setup(addr,size,mode,io) alpha_fd_dma_setup(addr,size,mode,io)
+
+static __inline__ int 
+alpha_fd_dma_setup(char *addr, unsigned long size, int mode, int io)
+{
+       static unsigned long prev_size;
+       static dma_addr_t bus_addr = 0;
+       static char *prev_addr;
+       static int prev_dir;
+       int dir;
+
+       dir = (mode != DMA_MODE_READ) ? PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE;
+
+       if (bus_addr 
+           && (addr != prev_addr || size != prev_size || dir != prev_dir)) {
+               /* different from last time -- unmap prev */
+               pci_unmap_single(isa_bridge, bus_addr, prev_size, prev_dir);
+               bus_addr = 0;
+       }
+
+       if (!bus_addr)  /* need to map it */
+               bus_addr = pci_map_single(isa_bridge, addr, size, dir);
+
+       /* remember this one as prev */
+       prev_addr = addr;
+       prev_size = size;
+       prev_dir = dir;
+
+       fd_clear_dma_ff();
+       fd_cacheflush(addr, size);
+       fd_set_dma_mode(mode);
+       set_dma_addr(FLOPPY_DMA, bus_addr);
+       fd_set_dma_count(size);
+       virtual_dma_port = io;
+       fd_enable_dma();
+
+       return 0;
+}
+
+#endif /* CONFIG_PCI */
+
+__inline__ void virtual_dma_init(void)
+{
+       /* Nothing to do on an Alpha */
+}
+
+static int FDC1 = 0x3f0;
+static int FDC2 = -1;
+
+/*
+ * Again, the CMOS information doesn't work on the alpha..
+ */
+#define FLOPPY0_TYPE 6
+#define FLOPPY1_TYPE 0
+
+#define N_FDC 2
+#define N_DRIVE 8
+
+/*
+ * Most Alphas have no problems with floppy DMA crossing 64k borders,
+ * except for certain ones, like XL and RUFFIAN.
+ *
+ * However, the test is simple and fast, and this *is* floppy, after all,
+ * so we do it for all platforms, just to make sure.
+ *
+ * This is advantageous in other circumstances as well, as in moving
+ * about the PCI DMA windows and forcing the floppy to start doing
+ * scatter-gather when it never had before, and there *is* a problem
+ * on that platform... ;-}
+ */
+
+static inline unsigned long CROSS_64KB(void *a, unsigned long s)
+{
+       unsigned long p = (unsigned long)a;
+       return ((p + s - 1) ^ p) & ~0xffffUL;
+}
+
+#define EXTRA_FLOPPY_PARAMS
+
+#endif /* __ASM_ALPHA_FLOPPY_H */
diff --git a/arch/alpha/include/asm/fpu.h b/arch/alpha/include/asm/fpu.h
new file mode 100644 (file)
index 0000000..ecb17a7
--- /dev/null
@@ -0,0 +1,193 @@
+#ifndef __ASM_ALPHA_FPU_H
+#define __ASM_ALPHA_FPU_H
+
+/*
+ * Alpha floating-point control register defines:
+ */
+#define FPCR_DNOD      (1UL<<47)       /* denorm INV trap disable */
+#define FPCR_DNZ       (1UL<<48)       /* denorms to zero */
+#define FPCR_INVD      (1UL<<49)       /* invalid op disable (opt.) */
+#define FPCR_DZED      (1UL<<50)       /* division by zero disable (opt.) */
+#define FPCR_OVFD      (1UL<<51)       /* overflow disable (optional) */
+#define FPCR_INV       (1UL<<52)       /* invalid operation */
+#define FPCR_DZE       (1UL<<53)       /* division by zero */
+#define FPCR_OVF       (1UL<<54)       /* overflow */
+#define FPCR_UNF       (1UL<<55)       /* underflow */
+#define FPCR_INE       (1UL<<56)       /* inexact */
+#define FPCR_IOV       (1UL<<57)       /* integer overflow */
+#define FPCR_UNDZ      (1UL<<60)       /* underflow to zero (opt.) */
+#define FPCR_UNFD      (1UL<<61)       /* underflow disable (opt.) */
+#define FPCR_INED      (1UL<<62)       /* inexact disable (opt.) */
+#define FPCR_SUM       (1UL<<63)       /* summary bit */
+
+#define FPCR_DYN_SHIFT 58              /* first dynamic rounding mode bit */
+#define FPCR_DYN_CHOPPED (0x0UL << FPCR_DYN_SHIFT)     /* towards 0 */
+#define FPCR_DYN_MINUS  (0x1UL << FPCR_DYN_SHIFT)      /* towards -INF */
+#define FPCR_DYN_NORMAL         (0x2UL << FPCR_DYN_SHIFT)      /* towards nearest */
+#define FPCR_DYN_PLUS   (0x3UL << FPCR_DYN_SHIFT)      /* towards +INF */
+#define FPCR_DYN_MASK   (0x3UL << FPCR_DYN_SHIFT)
+
+#define FPCR_MASK      0xffff800000000000L
+
+/*
+ * IEEE trap enables are implemented in software.  These per-thread
+ * bits are stored in the "ieee_state" field of "struct thread_info".
+ * Thus, the bits are defined so as not to conflict with the
+ * floating-point enable bit (which is architected).  On top of that,
+ * we want to make these bits compatible with OSF/1 so
+ * ieee_set_fp_control() etc. can be implemented easily and
+ * compatibly.  The corresponding definitions are in
+ * /usr/include/machine/fpu.h under OSF/1.
+ */
+#define IEEE_TRAP_ENABLE_INV   (1UL<<1)        /* invalid op */
+#define IEEE_TRAP_ENABLE_DZE   (1UL<<2)        /* division by zero */
+#define IEEE_TRAP_ENABLE_OVF   (1UL<<3)        /* overflow */
+#define IEEE_TRAP_ENABLE_UNF   (1UL<<4)        /* underflow */
+#define IEEE_TRAP_ENABLE_INE   (1UL<<5)        /* inexact */
+#define IEEE_TRAP_ENABLE_DNO   (1UL<<6)        /* denorm */
+#define IEEE_TRAP_ENABLE_MASK  (IEEE_TRAP_ENABLE_INV | IEEE_TRAP_ENABLE_DZE |\
+                                IEEE_TRAP_ENABLE_OVF | IEEE_TRAP_ENABLE_UNF |\
+                                IEEE_TRAP_ENABLE_INE | IEEE_TRAP_ENABLE_DNO)
+
+/* Denorm and Underflow flushing */
+#define IEEE_MAP_DMZ           (1UL<<12)       /* Map denorm inputs to zero */
+#define IEEE_MAP_UMZ           (1UL<<13)       /* Map underflowed outputs to zero */
+
+#define IEEE_MAP_MASK          (IEEE_MAP_DMZ | IEEE_MAP_UMZ)
+
+/* status bits coming from fpcr: */
+#define IEEE_STATUS_INV                (1UL<<17)
+#define IEEE_STATUS_DZE                (1UL<<18)
+#define IEEE_STATUS_OVF                (1UL<<19)
+#define IEEE_STATUS_UNF                (1UL<<20)
+#define IEEE_STATUS_INE                (1UL<<21)
+#define IEEE_STATUS_DNO                (1UL<<22)
+
+#define IEEE_STATUS_MASK       (IEEE_STATUS_INV | IEEE_STATUS_DZE |    \
+                                IEEE_STATUS_OVF | IEEE_STATUS_UNF |    \
+                                IEEE_STATUS_INE | IEEE_STATUS_DNO)
+
+#define IEEE_SW_MASK           (IEEE_TRAP_ENABLE_MASK |                \
+                                IEEE_STATUS_MASK | IEEE_MAP_MASK)
+
+#define IEEE_CURRENT_RM_SHIFT  32
+#define IEEE_CURRENT_RM_MASK   (3UL<<IEEE_CURRENT_RM_SHIFT)
+
+#define IEEE_STATUS_TO_EXCSUM_SHIFT    16
+
+#define IEEE_INHERIT    (1UL<<63)      /* inherit on thread create? */
+
+/*
+ * Convert the software IEEE trap enable and status bits into the
+ * hardware fpcr format. 
+ *
+ * Digital Unix engineers receive my thanks for not defining the
+ * software bits identical to the hardware bits.  The chip designers
+ * receive my thanks for making all the not-implemented fpcr bits
+ * RAZ forcing us to use system calls to read/write this value.
+ */
+
+static inline unsigned long
+ieee_swcr_to_fpcr(unsigned long sw)
+{
+       unsigned long fp;
+       fp = (sw & IEEE_STATUS_MASK) << 35;
+       fp |= (sw & IEEE_MAP_DMZ) << 36;
+       fp |= (sw & IEEE_STATUS_MASK ? FPCR_SUM : 0);
+       fp |= (~sw & (IEEE_TRAP_ENABLE_INV
+                     | IEEE_TRAP_ENABLE_DZE
+                     | IEEE_TRAP_ENABLE_OVF)) << 48;
+       fp |= (~sw & (IEEE_TRAP_ENABLE_UNF | IEEE_TRAP_ENABLE_INE)) << 57;
+       fp |= (sw & IEEE_MAP_UMZ ? FPCR_UNDZ | FPCR_UNFD : 0);
+       fp |= (~sw & IEEE_TRAP_ENABLE_DNO) << 41;
+       return fp;
+}
+
+static inline unsigned long
+ieee_fpcr_to_swcr(unsigned long fp)
+{
+       unsigned long sw;
+       sw = (fp >> 35) & IEEE_STATUS_MASK;
+       sw |= (fp >> 36) & IEEE_MAP_DMZ;
+       sw |= (~fp >> 48) & (IEEE_TRAP_ENABLE_INV
+                            | IEEE_TRAP_ENABLE_DZE
+                            | IEEE_TRAP_ENABLE_OVF);
+       sw |= (~fp >> 57) & (IEEE_TRAP_ENABLE_UNF | IEEE_TRAP_ENABLE_INE);
+       sw |= (fp >> 47) & IEEE_MAP_UMZ;
+       sw |= (~fp >> 41) & IEEE_TRAP_ENABLE_DNO;
+       return sw;
+}
+
+#ifdef __KERNEL__
+
+/* The following two functions don't need trapb/excb instructions
+   around the mf_fpcr/mt_fpcr instructions because (a) the kernel
+   never generates arithmetic faults and (b) call_pal instructions
+   are implied trap barriers.  */
+
+static inline unsigned long
+rdfpcr(void)
+{
+       unsigned long tmp, ret;
+
+#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
+       __asm__ __volatile__ (
+               "ftoit $f0,%0\n\t"
+               "mf_fpcr $f0\n\t"
+               "ftoit $f0,%1\n\t"
+               "itoft %0,$f0"
+               : "=r"(tmp), "=r"(ret));
+#else
+       __asm__ __volatile__ (
+               "stt $f0,%0\n\t"
+               "mf_fpcr $f0\n\t"
+               "stt $f0,%1\n\t"
+               "ldt $f0,%0"
+               : "=m"(tmp), "=m"(ret));
+#endif
+
+       return ret;
+}
+
+static inline void
+wrfpcr(unsigned long val)
+{
+       unsigned long tmp;
+
+#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
+       __asm__ __volatile__ (
+               "ftoit $f0,%0\n\t"
+               "itoft %1,$f0\n\t"
+               "mt_fpcr $f0\n\t"
+               "itoft %0,$f0"
+               : "=&r"(tmp) : "r"(val));
+#else
+       __asm__ __volatile__ (
+               "stt $f0,%0\n\t"
+               "ldt $f0,%1\n\t"
+               "mt_fpcr $f0\n\t"
+               "ldt $f0,%0"
+               : "=m"(tmp) : "m"(val));
+#endif
+}
+
+static inline unsigned long
+swcr_update_status(unsigned long swcr, unsigned long fpcr)
+{
+       /* EV6 implements most of the bits in hardware.  Collect
+          the acrued exception bits from the real fpcr.  */
+       if (implver() == IMPLVER_EV6) {
+               swcr &= ~IEEE_STATUS_MASK;
+               swcr |= (fpcr >> 35) & IEEE_STATUS_MASK;
+       }
+       return swcr;
+}
+
+extern unsigned long alpha_read_fp_reg (unsigned long reg);
+extern void alpha_write_fp_reg (unsigned long reg, unsigned long val);
+extern unsigned long alpha_read_fp_reg_s (unsigned long reg);
+extern void alpha_write_fp_reg_s (unsigned long reg, unsigned long val);
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASM_ALPHA_FPU_H */
diff --git a/arch/alpha/include/asm/futex.h b/arch/alpha/include/asm/futex.h
new file mode 100644 (file)
index 0000000..6a332a9
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _ASM_FUTEX_H
+#define _ASM_FUTEX_H
+
+#include <asm-generic/futex.h>
+
+#endif
diff --git a/arch/alpha/include/asm/gct.h b/arch/alpha/include/asm/gct.h
new file mode 100644 (file)
index 0000000..3504c70
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef __ALPHA_GCT_H
+#define __ALPHA_GCT_H
+
+typedef u64 gct_id;
+typedef u64 gct6_handle;
+
+typedef struct __gct6_node {
+       u8 type;        
+       u8 subtype;
+       u16 size;
+       u32 hd_extension;
+       gct6_handle owner;
+       gct6_handle active_user;
+       gct_id id;
+       u64 flags;
+       u16 rev;
+       u16 change_counter;
+       u16 max_child;
+       u16 reserved1;
+       gct6_handle saved_owner;
+       gct6_handle affinity;
+       gct6_handle parent;
+       gct6_handle next;
+       gct6_handle prev;
+       gct6_handle child;
+       u64 fw_flags;
+       u64 os_usage;
+       u64 fru_id;
+       u32 checksum;
+       u32 magic;      /* 'GLXY' */
+} gct6_node;
+
+typedef struct {
+       u8 type;        
+       u8 subtype;
+       void (*callout)(gct6_node *);
+} gct6_search_struct;
+
+#define GCT_NODE_MAGIC   0x59584c47    /* 'GLXY' */
+
+/* 
+ * node types 
+ */
+#define GCT_TYPE_HOSE                  0x0E
+
+/*
+ * node subtypes
+ */
+#define GCT_SUBTYPE_IO_PORT_MODULE     0x2C
+
+#define GCT_NODE_PTR(off) ((gct6_node *)((char *)hwrpb +               \
+                                        hwrpb->frut_offset +           \
+                                        (gct6_handle)(off)))           \
+
+int gct6_find_nodes(gct6_node *, gct6_search_struct *);
+
+#endif /* __ALPHA_GCT_H */
+
diff --git a/arch/alpha/include/asm/gentrap.h b/arch/alpha/include/asm/gentrap.h
new file mode 100644 (file)
index 0000000..ae50cc3
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef _ASMAXP_GENTRAP_H
+#define _ASMAXP_GENTRAP_H
+
+/*
+ * Definitions for gentrap causes.  They are generated by user-level
+ * programs and therefore should be compatible with the corresponding
+ * OSF/1 definitions.
+ */
+#define GEN_INTOVF     -1      /* integer overflow */
+#define GEN_INTDIV     -2      /* integer division by zero */
+#define GEN_FLTOVF     -3      /* fp overflow */
+#define GEN_FLTDIV     -4      /* fp division by zero */
+#define GEN_FLTUND     -5      /* fp underflow */
+#define GEN_FLTINV     -6      /* invalid fp operand */
+#define GEN_FLTINE     -7      /* inexact fp operand */
+#define GEN_DECOVF     -8      /* decimal overflow (for COBOL??) */
+#define GEN_DECDIV     -9      /* decimal division by zero */
+#define GEN_DECINV     -10     /* invalid decimal operand */
+#define GEN_ROPRAND    -11     /* reserved operand */
+#define GEN_ASSERTERR  -12     /* assertion error */
+#define GEN_NULPTRERR  -13     /* null pointer error */
+#define GEN_STKOVF     -14     /* stack overflow */
+#define GEN_STRLENERR  -15     /* string length error */
+#define GEN_SUBSTRERR  -16     /* substring error */
+#define GEN_RANGERR    -17     /* range error */
+#define GEN_SUBRNG     -18
+#define GEN_SUBRNG1    -19      
+#define GEN_SUBRNG2    -20
+#define GEN_SUBRNG3    -21     /* these report range errors for */
+#define GEN_SUBRNG4    -22     /* subscripting (indexing) at levels 0..7 */
+#define GEN_SUBRNG5    -23
+#define GEN_SUBRNG6    -24
+#define GEN_SUBRNG7    -25
+
+/* the remaining codes (-26..-1023) are reserved. */
+
+#endif /* _ASMAXP_GENTRAP_H */
diff --git a/arch/alpha/include/asm/hardirq.h b/arch/alpha/include/asm/hardirq.h
new file mode 100644 (file)
index 0000000..d953e23
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef _ALPHA_HARDIRQ_H
+#define _ALPHA_HARDIRQ_H
+
+#include <linux/threads.h>
+#include <linux/cache.h>
+
+
+/* entry.S is sensitive to the offsets of these fields */
+typedef struct {
+       unsigned long __softirq_pending;
+} ____cacheline_aligned irq_cpustat_t;
+
+#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
+
+void ack_bad_irq(unsigned int irq);
+
+#define HARDIRQ_BITS   12
+
+/*
+ * The hardirq mask has to be large enough to have
+ * space for potentially nestable IRQ sources in the system
+ * to nest on a single CPU. On Alpha, interrupts are masked at the CPU
+ * by IPL as well as at the system level. We only have 8 IPLs (UNIX PALcode)
+ * so we really only have 8 nestable IRQs, but allow some overhead
+ */
+#if (1 << HARDIRQ_BITS) < 16
+#error HARDIRQ_BITS is too low!
+#endif
+
+#endif /* _ALPHA_HARDIRQ_H */
diff --git a/arch/alpha/include/asm/hw_irq.h b/arch/alpha/include/asm/hw_irq.h
new file mode 100644 (file)
index 0000000..a37db0f
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef _ALPHA_HW_IRQ_H
+#define _ALPHA_HW_IRQ_H
+
+
+extern volatile unsigned long irq_err_count;
+
+#ifdef CONFIG_ALPHA_GENERIC
+#define ACTUAL_NR_IRQS alpha_mv.nr_irqs
+#else
+#define ACTUAL_NR_IRQS NR_IRQS
+#endif
+
+#endif
diff --git a/arch/alpha/include/asm/hwrpb.h b/arch/alpha/include/asm/hwrpb.h
new file mode 100644 (file)
index 0000000..8e8f871
--- /dev/null
@@ -0,0 +1,220 @@
+#ifndef __ALPHA_HWRPB_H
+#define __ALPHA_HWRPB_H
+
+#define INIT_HWRPB ((struct hwrpb_struct *) 0x10000000)
+
+/*
+ * DEC processor types for Alpha systems.  Found in HWRPB.
+ * These values are architected.
+ */
+
+#define EV3_CPU                 1       /* EV3                  */
+#define EV4_CPU                 2       /* EV4 (21064)          */
+#define LCA4_CPU                4       /* LCA4 (21066/21068)   */
+#define EV5_CPU                 5       /* EV5 (21164)          */
+#define EV45_CPU                6       /* EV4.5 (21064/xxx)    */
+#define EV56_CPU               7       /* EV5.6 (21164)        */
+#define EV6_CPU                        8       /* EV6 (21264)          */
+#define PCA56_CPU              9       /* PCA56 (21164PC)      */
+#define PCA57_CPU              10      /* PCA57 (notyet)       */
+#define EV67_CPU               11      /* EV67 (21264A)        */
+#define EV68CB_CPU             12      /* EV68CB (21264C)      */
+#define EV68AL_CPU             13      /* EV68AL (21264B)      */
+#define EV68CX_CPU             14      /* EV68CX (21264D)      */
+#define EV7_CPU                        15      /* EV7 (21364)          */
+#define EV79_CPU               16      /* EV79 (21364??)       */
+#define EV69_CPU               17      /* EV69 (21264/EV69A)   */
+
+/*
+ * DEC system types for Alpha systems.  Found in HWRPB.
+ * These values are architected.
+ */
+
+#define ST_ADU                   1     /* Alpha ADU systype    */
+#define ST_DEC_4000              2     /* Cobra systype        */
+#define ST_DEC_7000              3     /* Ruby systype         */
+#define ST_DEC_3000_500                  4     /* Flamingo systype     */
+#define ST_DEC_2000_300                  6     /* Jensen systype       */
+#define ST_DEC_3000_300                  7     /* Pelican systype      */
+#define ST_DEC_2100_A500         9     /* Sable systype        */
+#define ST_DEC_AXPVME_64        10     /* AXPvme system type   */
+#define ST_DEC_AXPPCI_33        11     /* NoName system type   */
+#define ST_DEC_TLASER           12     /* Turbolaser systype   */
+#define ST_DEC_2100_A50                 13     /* Avanti systype       */
+#define ST_DEC_MUSTANG          14     /* Mustang systype      */
+#define ST_DEC_ALCOR            15     /* Alcor (EV5) systype  */
+#define ST_DEC_1000             17     /* Mikasa systype       */
+#define ST_DEC_EB64             18     /* EB64 systype         */
+#define ST_DEC_EB66             19     /* EB66 systype         */
+#define ST_DEC_EB64P            20     /* EB64+ systype        */
+#define ST_DEC_BURNS            21     /* laptop systype       */
+#define ST_DEC_RAWHIDE          22     /* Rawhide systype      */
+#define ST_DEC_K2               23     /* K2 systype           */
+#define ST_DEC_LYNX             24     /* Lynx systype         */
+#define ST_DEC_XL               25     /* Alpha XL systype     */
+#define ST_DEC_EB164            26     /* EB164 systype        */
+#define ST_DEC_NORITAKE                 27     /* Noritake systype     */
+#define ST_DEC_CORTEX           28     /* Cortex systype       */
+#define ST_DEC_MIATA            30     /* Miata systype        */
+#define ST_DEC_XXM              31     /* XXM systype          */
+#define ST_DEC_TAKARA           32     /* Takara systype       */
+#define ST_DEC_YUKON            33     /* Yukon systype        */
+#define ST_DEC_TSUNAMI          34     /* Tsunami systype      */
+#define ST_DEC_WILDFIRE                 35     /* Wildfire systype     */
+#define ST_DEC_CUSCO            36     /* CUSCO systype        */
+#define ST_DEC_EIGER            37     /* Eiger systype        */
+#define ST_DEC_TITAN            38     /* Titan systype        */
+#define ST_DEC_MARVEL           39     /* Marvel systype       */
+
+/* UNOFFICIAL!!! */
+#define ST_UNOFFICIAL_BIAS     100
+#define ST_DTI_RUFFIAN         101     /* RUFFIAN systype      */
+
+/* Alpha Processor, Inc. systems */
+#define ST_API_BIAS            200
+#define ST_API_NAUTILUS                201     /* UP1000 systype       */
+
+struct pcb_struct {
+       unsigned long ksp;
+       unsigned long usp;
+       unsigned long ptbr;
+       unsigned int pcc;
+       unsigned int asn;
+       unsigned long unique;
+       unsigned long flags;
+       unsigned long res1, res2;
+};
+
+struct percpu_struct {
+       unsigned long hwpcb[16];
+       unsigned long flags;
+       unsigned long pal_mem_size;
+       unsigned long pal_scratch_size;
+       unsigned long pal_mem_pa;
+       unsigned long pal_scratch_pa;
+       unsigned long pal_revision;
+       unsigned long type;
+       unsigned long variation;
+       unsigned long revision;
+       unsigned long serial_no[2];
+       unsigned long logout_area_pa;
+       unsigned long logout_area_len;
+       unsigned long halt_PCBB;
+       unsigned long halt_PC;
+       unsigned long halt_PS;
+       unsigned long halt_arg;
+       unsigned long halt_ra;
+       unsigned long halt_pv;
+       unsigned long halt_reason;
+       unsigned long res;
+       unsigned long ipc_buffer[21];
+       unsigned long palcode_avail[16];
+       unsigned long compatibility;
+       unsigned long console_data_log_pa;
+       unsigned long console_data_log_length;
+       unsigned long bcache_info;
+};
+
+struct procdesc_struct {
+       unsigned long weird_vms_stuff;
+       unsigned long address;
+};
+
+struct vf_map_struct {
+       unsigned long va;
+       unsigned long pa;
+       unsigned long count;
+};
+
+struct crb_struct {
+       struct procdesc_struct * dispatch_va;
+       struct procdesc_struct * dispatch_pa;
+       struct procdesc_struct * fixup_va;
+       struct procdesc_struct * fixup_pa;
+       /* virtual->physical map */
+       unsigned long map_entries;
+       unsigned long map_pages;
+       struct vf_map_struct map[1];
+};
+
+struct memclust_struct {
+       unsigned long start_pfn;
+       unsigned long numpages;
+       unsigned long numtested;
+       unsigned long bitmap_va;
+       unsigned long bitmap_pa;
+       unsigned long bitmap_chksum;
+       unsigned long usage;
+};
+
+struct memdesc_struct {
+       unsigned long chksum;
+       unsigned long optional_pa;
+       unsigned long numclusters;
+       struct memclust_struct cluster[0];
+};
+
+struct dsr_struct {
+       long smm;                       /* SMM nubber used by LMF       */
+       unsigned long  lurt_off;        /* offset to LURT table         */
+       unsigned long  sysname_off;     /* offset to sysname char count */
+};
+
+struct hwrpb_struct {
+       unsigned long phys_addr;        /* check: physical address of the hwrpb */
+       unsigned long id;               /* check: "HWRPB\0\0\0" */
+       unsigned long revision; 
+       unsigned long size;             /* size of hwrpb */
+       unsigned long cpuid;
+       unsigned long pagesize;         /* 8192, I hope */
+       unsigned long pa_bits;          /* number of physical address bits */
+       unsigned long max_asn;
+       unsigned char ssn[16];          /* system serial number: big bother is watching */
+       unsigned long sys_type;
+       unsigned long sys_variation;
+       unsigned long sys_revision;
+       unsigned long intr_freq;        /* interval clock frequency * 4096 */
+       unsigned long cycle_freq;       /* cycle counter frequency */
+       unsigned long vptb;             /* Virtual Page Table Base address */
+       unsigned long res1;
+       unsigned long tbhb_offset;      /* Translation Buffer Hint Block */
+       unsigned long nr_processors;
+       unsigned long processor_size;
+       unsigned long processor_offset;
+       unsigned long ctb_nr;
+       unsigned long ctb_size;         /* console terminal block size */
+       unsigned long ctbt_offset;      /* console terminal block table offset */
+       unsigned long crb_offset;       /* console callback routine block */
+       unsigned long mddt_offset;      /* memory data descriptor table */
+       unsigned long cdb_offset;       /* configuration data block (or NULL) */
+       unsigned long frut_offset;      /* FRU table (or NULL) */
+       void (*save_terminal)(unsigned long);
+       unsigned long save_terminal_data;
+       void (*restore_terminal)(unsigned long);
+       unsigned long restore_terminal_data;
+       void (*CPU_restart)(unsigned long);
+       unsigned long CPU_restart_data;
+       unsigned long res2;
+       unsigned long res3;
+       unsigned long chksum;
+       unsigned long rxrdy;
+       unsigned long txrdy;
+       unsigned long dsr_offset;       /* "Dynamic System Recognition Data Block Table" */
+};
+
+#ifdef __KERNEL__
+
+extern struct hwrpb_struct *hwrpb;
+
+static inline void
+hwrpb_update_checksum(struct hwrpb_struct *h)
+{
+       unsigned long sum = 0, *l;
+        for (l = (unsigned long *) h; l < (unsigned long *) &h->chksum; ++l)
+                sum += *l;
+        h->chksum = sum;
+}
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_HWRPB_H */
diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h
new file mode 100644 (file)
index 0000000..e971ab0
--- /dev/null
@@ -0,0 +1,577 @@
+#ifndef __ALPHA_IO_H
+#define __ALPHA_IO_H
+
+#ifdef __KERNEL__
+
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <asm/compiler.h>
+#include <asm/system.h>
+#include <asm/pgtable.h>
+#include <asm/machvec.h>
+#include <asm/hwrpb.h>
+
+/* The generic header contains only prototypes.  Including it ensures that
+   the implementation we have here matches that interface.  */
+#include <asm-generic/iomap.h>
+
+/* We don't use IO slowdowns on the Alpha, but.. */
+#define __SLOW_DOWN_IO do { } while (0)
+#define SLOW_DOWN_IO   do { } while (0)
+
+/*
+ * Virtual -> physical identity mapping starts at this offset
+ */
+#ifdef USE_48_BIT_KSEG
+#define IDENT_ADDR     0xffff800000000000UL
+#else
+#define IDENT_ADDR     0xfffffc0000000000UL
+#endif
+
+/*
+ * We try to avoid hae updates (thus the cache), but when we
+ * do need to update the hae, we need to do it atomically, so
+ * that any interrupts wouldn't get confused with the hae
+ * register not being up-to-date with respect to the hardware
+ * value.
+ */
+extern inline void __set_hae(unsigned long new_hae)
+{
+       unsigned long flags;
+       local_irq_save(flags);
+
+       alpha_mv.hae_cache = new_hae;
+       *alpha_mv.hae_register = new_hae;
+       mb();
+       /* Re-read to make sure it was written.  */
+       new_hae = *alpha_mv.hae_register;
+
+       local_irq_restore(flags);
+}
+
+extern inline void set_hae(unsigned long new_hae)
+{
+       if (new_hae != alpha_mv.hae_cache)
+               __set_hae(new_hae);
+}
+
+/*
+ * Change virtual addresses to physical addresses and vv.
+ */
+#ifdef USE_48_BIT_KSEG
+static inline unsigned long virt_to_phys(void *address)
+{
+       return (unsigned long)address - IDENT_ADDR;
+}
+
+static inline void * phys_to_virt(unsigned long address)
+{
+       return (void *) (address + IDENT_ADDR);
+}
+#else
+static inline unsigned long virt_to_phys(void *address)
+{
+        unsigned long phys = (unsigned long)address;
+
+       /* Sign-extend from bit 41.  */
+       phys <<= (64 - 41);
+       phys = (long)phys >> (64 - 41);
+
+       /* Crop to the physical address width of the processor.  */
+        phys &= (1ul << hwrpb->pa_bits) - 1;
+
+        return phys;
+}
+
+static inline void * phys_to_virt(unsigned long address)
+{
+        return (void *)(IDENT_ADDR + (address & ((1ul << 41) - 1)));
+}
+#endif
+
+#define page_to_phys(page)     page_to_pa(page)
+
+static inline dma_addr_t __deprecated isa_page_to_bus(struct page *page)
+{
+       return page_to_phys(page);
+}
+
+/* This depends on working iommu.  */
+#define BIO_VMERGE_BOUNDARY    (alpha_mv.mv_pci_tbi ? PAGE_SIZE : 0)
+
+/* Maximum PIO space address supported?  */
+#define IO_SPACE_LIMIT 0xffff
+
+/*
+ * Change addresses as seen by the kernel (virtual) to addresses as
+ * seen by a device (bus), and vice versa.
+ *
+ * Note that this only works for a limited range of kernel addresses,
+ * and very well may not span all memory.  Consider this interface 
+ * deprecated in favour of the DMA-mapping API.
+ */
+extern unsigned long __direct_map_base;
+extern unsigned long __direct_map_size;
+
+static inline unsigned long __deprecated virt_to_bus(void *address)
+{
+       unsigned long phys = virt_to_phys(address);
+       unsigned long bus = phys + __direct_map_base;
+       return phys <= __direct_map_size ? bus : 0;
+}
+#define isa_virt_to_bus virt_to_bus
+
+static inline void * __deprecated bus_to_virt(unsigned long address)
+{
+       void *virt;
+
+       /* This check is a sanity check but also ensures that bus address 0
+          maps to virtual address 0 which is useful to detect null pointers
+          (the NCR driver is much simpler if NULL pointers are preserved).  */
+       address -= __direct_map_base;
+       virt = phys_to_virt(address);
+       return (long)address <= 0 ? NULL : virt;
+}
+#define isa_bus_to_virt bus_to_virt
+
+/*
+ * There are different chipsets to interface the Alpha CPUs to the world.
+ */
+
+#define IO_CONCAT(a,b) _IO_CONCAT(a,b)
+#define _IO_CONCAT(a,b)        a ## _ ## b
+
+#ifdef CONFIG_ALPHA_GENERIC
+
+/* In a generic kernel, we always go through the machine vector.  */
+
+#define REMAP1(TYPE, NAME, QUAL)                                       \
+static inline TYPE generic_##NAME(QUAL void __iomem *addr)             \
+{                                                                      \
+       return alpha_mv.mv_##NAME(addr);                                \
+}
+
+#define REMAP2(TYPE, NAME, QUAL)                                       \
+static inline void generic_##NAME(TYPE b, QUAL void __iomem *addr)     \
+{                                                                      \
+       alpha_mv.mv_##NAME(b, addr);                                    \
+}
+
+REMAP1(unsigned int, ioread8, /**/)
+REMAP1(unsigned int, ioread16, /**/)
+REMAP1(unsigned int, ioread32, /**/)
+REMAP1(u8, readb, const volatile)
+REMAP1(u16, readw, const volatile)
+REMAP1(u32, readl, const volatile)
+REMAP1(u64, readq, const volatile)
+
+REMAP2(u8, iowrite8, /**/)
+REMAP2(u16, iowrite16, /**/)
+REMAP2(u32, iowrite32, /**/)
+REMAP2(u8, writeb, volatile)
+REMAP2(u16, writew, volatile)
+REMAP2(u32, writel, volatile)
+REMAP2(u64, writeq, volatile)
+
+#undef REMAP1
+#undef REMAP2
+
+extern inline void __iomem *generic_ioportmap(unsigned long a)
+{
+       return alpha_mv.mv_ioportmap(a);
+}
+
+static inline void __iomem *generic_ioremap(unsigned long a, unsigned long s)
+{
+       return alpha_mv.mv_ioremap(a, s);
+}
+
+static inline void generic_iounmap(volatile void __iomem *a)
+{
+       return alpha_mv.mv_iounmap(a);
+}
+
+static inline int generic_is_ioaddr(unsigned long a)
+{
+       return alpha_mv.mv_is_ioaddr(a);
+}
+
+static inline int generic_is_mmio(const volatile void __iomem *a)
+{
+       return alpha_mv.mv_is_mmio(a);
+}
+
+#define __IO_PREFIX            generic
+#define generic_trivial_rw_bw  0
+#define generic_trivial_rw_lq  0
+#define generic_trivial_io_bw  0
+#define generic_trivial_io_lq  0
+#define generic_trivial_iounmap        0
+
+#else
+
+#if defined(CONFIG_ALPHA_APECS)
+# include <asm/core_apecs.h>
+#elif defined(CONFIG_ALPHA_CIA)
+# include <asm/core_cia.h>
+#elif defined(CONFIG_ALPHA_IRONGATE)
+# include <asm/core_irongate.h>
+#elif defined(CONFIG_ALPHA_JENSEN)
+# include <asm/jensen.h>
+#elif defined(CONFIG_ALPHA_LCA)
+# include <asm/core_lca.h>
+#elif defined(CONFIG_ALPHA_MARVEL)
+# include <asm/core_marvel.h>
+#elif defined(CONFIG_ALPHA_MCPCIA)
+# include <asm/core_mcpcia.h>
+#elif defined(CONFIG_ALPHA_POLARIS)
+# include <asm/core_polaris.h>
+#elif defined(CONFIG_ALPHA_T2)
+# include <asm/core_t2.h>
+#elif defined(CONFIG_ALPHA_TSUNAMI)
+# include <asm/core_tsunami.h>
+#elif defined(CONFIG_ALPHA_TITAN)
+# include <asm/core_titan.h>
+#elif defined(CONFIG_ALPHA_WILDFIRE)
+# include <asm/core_wildfire.h>
+#else
+#error "What system is this?"
+#endif
+
+#endif /* GENERIC */
+
+/*
+ * We always have external versions of these routines.
+ */
+extern u8              inb(unsigned long port);
+extern u16             inw(unsigned long port);
+extern u32             inl(unsigned long port);
+extern void            outb(u8 b, unsigned long port);
+extern void            outw(u16 b, unsigned long port);
+extern void            outl(u32 b, unsigned long port);
+
+extern u8              readb(const volatile void __iomem *addr);
+extern u16             readw(const volatile void __iomem *addr);
+extern u32             readl(const volatile void __iomem *addr);
+extern u64             readq(const volatile void __iomem *addr);
+extern void            writeb(u8 b, volatile void __iomem *addr);
+extern void            writew(u16 b, volatile void __iomem *addr);
+extern void            writel(u32 b, volatile void __iomem *addr);
+extern void            writeq(u64 b, volatile void __iomem *addr);
+
+extern u8              __raw_readb(const volatile void __iomem *addr);
+extern u16             __raw_readw(const volatile void __iomem *addr);
+extern u32             __raw_readl(const volatile void __iomem *addr);
+extern u64             __raw_readq(const volatile void __iomem *addr);
+extern void            __raw_writeb(u8 b, volatile void __iomem *addr);
+extern void            __raw_writew(u16 b, volatile void __iomem *addr);
+extern void            __raw_writel(u32 b, volatile void __iomem *addr);
+extern void            __raw_writeq(u64 b, volatile void __iomem *addr);
+
+/*
+ * Mapping from port numbers to __iomem space is pretty easy.
+ */
+
+/* These two have to be extern inline because of the extern prototype from
+   <asm-generic/iomap.h>.  It is not legal to mix "extern" and "static" for
+   the same declaration.  */
+extern inline void __iomem *ioport_map(unsigned long port, unsigned int size)
+{
+       return IO_CONCAT(__IO_PREFIX,ioportmap) (port);
+}
+
+extern inline void ioport_unmap(void __iomem *addr)
+{
+}
+
+static inline void __iomem *ioremap(unsigned long port, unsigned long size)
+{
+       return IO_CONCAT(__IO_PREFIX,ioremap) (port, size);
+}
+
+static inline void __iomem *__ioremap(unsigned long port, unsigned long size,
+                                     unsigned long flags)
+{
+       return ioremap(port, size);
+}
+
+static inline void __iomem * ioremap_nocache(unsigned long offset,
+                                            unsigned long size)
+{
+       return ioremap(offset, size);
+} 
+
+static inline void iounmap(volatile void __iomem *addr)
+{
+       IO_CONCAT(__IO_PREFIX,iounmap)(addr);
+}
+
+static inline int __is_ioaddr(unsigned long addr)
+{
+       return IO_CONCAT(__IO_PREFIX,is_ioaddr)(addr);
+}
+#define __is_ioaddr(a)         __is_ioaddr((unsigned long)(a))
+
+static inline int __is_mmio(const volatile void __iomem *addr)
+{
+       return IO_CONCAT(__IO_PREFIX,is_mmio)(addr);
+}
+
+
+/*
+ * If the actual I/O bits are sufficiently trivial, then expand inline.
+ */
+
+#if IO_CONCAT(__IO_PREFIX,trivial_io_bw)
+extern inline unsigned int ioread8(void __iomem *addr)
+{
+       unsigned int ret = IO_CONCAT(__IO_PREFIX,ioread8)(addr);
+       mb();
+       return ret;
+}
+
+extern inline unsigned int ioread16(void __iomem *addr)
+{
+       unsigned int ret = IO_CONCAT(__IO_PREFIX,ioread16)(addr);
+       mb();
+       return ret;
+}
+
+extern inline void iowrite8(u8 b, void __iomem *addr)
+{
+       IO_CONCAT(__IO_PREFIX,iowrite8)(b, addr);
+       mb();
+}
+
+extern inline void iowrite16(u16 b, void __iomem *addr)
+{
+       IO_CONCAT(__IO_PREFIX,iowrite16)(b, addr);
+       mb();
+}
+
+extern inline u8 inb(unsigned long port)
+{
+       return ioread8(ioport_map(port, 1));
+}
+
+extern inline u16 inw(unsigned long port)
+{
+       return ioread16(ioport_map(port, 2));
+}
+
+extern inline void outb(u8 b, unsigned long port)
+{
+       iowrite8(b, ioport_map(port, 1));
+}
+
+extern inline void outw(u16 b, unsigned long port)
+{
+       iowrite16(b, ioport_map(port, 2));
+}
+#endif
+
+#if IO_CONCAT(__IO_PREFIX,trivial_io_lq)
+extern inline unsigned int ioread32(void __iomem *addr)
+{
+       unsigned int ret = IO_CONCAT(__IO_PREFIX,ioread32)(addr);
+       mb();
+       return ret;
+}
+
+extern inline void iowrite32(u32 b, void __iomem *addr)
+{
+       IO_CONCAT(__IO_PREFIX,iowrite32)(b, addr);
+       mb();
+}
+
+extern inline u32 inl(unsigned long port)
+{
+       return ioread32(ioport_map(port, 4));
+}
+
+extern inline void outl(u32 b, unsigned long port)
+{
+       iowrite32(b, ioport_map(port, 4));
+}
+#endif
+
+#if IO_CONCAT(__IO_PREFIX,trivial_rw_bw) == 1
+extern inline u8 __raw_readb(const volatile void __iomem *addr)
+{
+       return IO_CONCAT(__IO_PREFIX,readb)(addr);
+}
+
+extern inline u16 __raw_readw(const volatile void __iomem *addr)
+{
+       return IO_CONCAT(__IO_PREFIX,readw)(addr);
+}
+
+extern inline void __raw_writeb(u8 b, volatile void __iomem *addr)
+{
+       IO_CONCAT(__IO_PREFIX,writeb)(b, addr);
+}
+
+extern inline void __raw_writew(u16 b, volatile void __iomem *addr)
+{
+       IO_CONCAT(__IO_PREFIX,writew)(b, addr);
+}
+
+extern inline u8 readb(const volatile void __iomem *addr)
+{
+       u8 ret = __raw_readb(addr);
+       mb();
+       return ret;
+}
+
+extern inline u16 readw(const volatile void __iomem *addr)
+{
+       u16 ret = __raw_readw(addr);
+       mb();
+       return ret;
+}
+
+extern inline void writeb(u8 b, volatile void __iomem *addr)
+{
+       __raw_writeb(b, addr);
+       mb();
+}
+
+extern inline void writew(u16 b, volatile void __iomem *addr)
+{
+       __raw_writew(b, addr);
+       mb();
+}
+#endif
+
+#if IO_CONCAT(__IO_PREFIX,trivial_rw_lq) == 1
+extern inline u32 __raw_readl(const volatile void __iomem *addr)
+{
+       return IO_CONCAT(__IO_PREFIX,readl)(addr);
+}
+
+extern inline u64 __raw_readq(const volatile void __iomem *addr)
+{
+       return IO_CONCAT(__IO_PREFIX,readq)(addr);
+}
+
+extern inline void __raw_writel(u32 b, volatile void __iomem *addr)
+{
+       IO_CONCAT(__IO_PREFIX,writel)(b, addr);
+}
+
+extern inline void __raw_writeq(u64 b, volatile void __iomem *addr)
+{
+       IO_CONCAT(__IO_PREFIX,writeq)(b, addr);
+}
+
+extern inline u32 readl(const volatile void __iomem *addr)
+{
+       u32 ret = __raw_readl(addr);
+       mb();
+       return ret;
+}
+
+extern inline u64 readq(const volatile void __iomem *addr)
+{
+       u64 ret = __raw_readq(addr);
+       mb();
+       return ret;
+}
+
+extern inline void writel(u32 b, volatile void __iomem *addr)
+{
+       __raw_writel(b, addr);
+       mb();
+}
+
+extern inline void writeq(u64 b, volatile void __iomem *addr)
+{
+       __raw_writeq(b, addr);
+       mb();
+}
+#endif
+
+#define inb_p          inb
+#define inw_p          inw
+#define inl_p          inl
+#define outb_p         outb
+#define outw_p         outw
+#define outl_p         outl
+#define readb_relaxed(addr) __raw_readb(addr)
+#define readw_relaxed(addr) __raw_readw(addr)
+#define readl_relaxed(addr) __raw_readl(addr)
+#define readq_relaxed(addr) __raw_readq(addr)
+
+#define mmiowb()
+
+/*
+ * String version of IO memory access ops:
+ */
+extern void memcpy_fromio(void *, const volatile void __iomem *, long);
+extern void memcpy_toio(volatile void __iomem *, const void *, long);
+extern void _memset_c_io(volatile void __iomem *, unsigned long, long);
+
+static inline void memset_io(volatile void __iomem *addr, u8 c, long len)
+{
+       _memset_c_io(addr, 0x0101010101010101UL * c, len);
+}
+
+#define __HAVE_ARCH_MEMSETW_IO
+static inline void memsetw_io(volatile void __iomem *addr, u16 c, long len)
+{
+       _memset_c_io(addr, 0x0001000100010001UL * c, len);
+}
+
+/*
+ * String versions of in/out ops:
+ */
+extern void insb (unsigned long port, void *dst, unsigned long count);
+extern void insw (unsigned long port, void *dst, unsigned long count);
+extern void insl (unsigned long port, void *dst, unsigned long count);
+extern void outsb (unsigned long port, const void *src, unsigned long count);
+extern void outsw (unsigned long port, const void *src, unsigned long count);
+extern void outsl (unsigned long port, const void *src, unsigned long count);
+
+/*
+ * The Alpha Jensen hardware for some rather strange reason puts
+ * the RTC clock at 0x170 instead of 0x70. Probably due to some
+ * misguided idea about using 0x70 for NMI stuff.
+ *
+ * These defines will override the defaults when doing RTC queries
+ */
+
+#ifdef CONFIG_ALPHA_GENERIC
+# define RTC_PORT(x)   ((x) + alpha_mv.rtc_port)
+#else
+# ifdef CONFIG_ALPHA_JENSEN
+#  define RTC_PORT(x)  (0x170+(x))
+# else
+#  define RTC_PORT(x)  (0x70 + (x))
+# endif
+#endif
+#define RTC_ALWAYS_BCD 0
+
+/*
+ * Some mucking forons use if[n]def writeq to check if platform has it.
+ * It's a bloody bad idea and we probably want ARCH_HAS_WRITEQ for them
+ * to play with; for now just use cpp anti-recursion logics and make sure
+ * that damn thing is defined and expands to itself.
+ */
+
+#define writeq writeq
+#define readq readq
+
+/*
+ * Convert a physical pointer to a virtual kernel pointer for /dev/mem
+ * access
+ */
+#define xlate_dev_mem_ptr(p)   __va(p)
+
+/*
+ * Convert a virtual cached pointer to an uncached pointer
+ */
+#define xlate_dev_kmem_ptr(p)  p
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_IO_H */
diff --git a/arch/alpha/include/asm/io_trivial.h b/arch/alpha/include/asm/io_trivial.h
new file mode 100644 (file)
index 0000000..1c77f10
--- /dev/null
@@ -0,0 +1,131 @@
+/* Trivial implementations of basic i/o routines.  Assumes that all
+   of the hard work has been done by ioremap and ioportmap, and that
+   access to i/o space is linear.  */
+
+/* This file may be included multiple times.  */
+
+#if IO_CONCAT(__IO_PREFIX,trivial_io_bw)
+__EXTERN_INLINE unsigned int
+IO_CONCAT(__IO_PREFIX,ioread8)(void __iomem *a)
+{
+       return __kernel_ldbu(*(volatile u8 __force *)a);
+}
+
+__EXTERN_INLINE unsigned int
+IO_CONCAT(__IO_PREFIX,ioread16)(void __iomem *a)
+{
+       return __kernel_ldwu(*(volatile u16 __force *)a);
+}
+
+__EXTERN_INLINE void
+IO_CONCAT(__IO_PREFIX,iowrite8)(u8 b, void __iomem *a)
+{
+       __kernel_stb(b, *(volatile u8 __force *)a);
+}
+
+__EXTERN_INLINE void
+IO_CONCAT(__IO_PREFIX,iowrite16)(u16 b, void __iomem *a)
+{
+       __kernel_stw(b, *(volatile u16 __force *)a);
+}
+#endif
+
+#if IO_CONCAT(__IO_PREFIX,trivial_io_lq)
+__EXTERN_INLINE unsigned int
+IO_CONCAT(__IO_PREFIX,ioread32)(void __iomem *a)
+{
+       return *(volatile u32 __force *)a;
+}
+
+__EXTERN_INLINE void
+IO_CONCAT(__IO_PREFIX,iowrite32)(u32 b, void __iomem *a)
+{
+       *(volatile u32 __force *)a = b;
+}
+#endif
+
+#if IO_CONCAT(__IO_PREFIX,trivial_rw_bw) == 1
+__EXTERN_INLINE u8
+IO_CONCAT(__IO_PREFIX,readb)(const volatile void __iomem *a)
+{
+       return __kernel_ldbu(*(const volatile u8 __force *)a);
+}
+
+__EXTERN_INLINE u16
+IO_CONCAT(__IO_PREFIX,readw)(const volatile void __iomem *a)
+{
+       return __kernel_ldwu(*(const volatile u16 __force *)a);
+}
+
+__EXTERN_INLINE void
+IO_CONCAT(__IO_PREFIX,writeb)(u8 b, volatile void __iomem *a)
+{
+       __kernel_stb(b, *(volatile u8 __force *)a);
+}
+
+__EXTERN_INLINE void
+IO_CONCAT(__IO_PREFIX,writew)(u16 b, volatile void __iomem *a)
+{
+       __kernel_stw(b, *(volatile u16 __force *)a);
+}
+#elif IO_CONCAT(__IO_PREFIX,trivial_rw_bw) == 2
+__EXTERN_INLINE u8
+IO_CONCAT(__IO_PREFIX,readb)(const volatile void __iomem *a)
+{
+       void __iomem *addr = (void __iomem *)a;
+       return IO_CONCAT(__IO_PREFIX,ioread8)(addr);
+}
+
+__EXTERN_INLINE u16
+IO_CONCAT(__IO_PREFIX,readw)(const volatile void __iomem *a)
+{
+       void __iomem *addr = (void __iomem *)a;
+       return IO_CONCAT(__IO_PREFIX,ioread16)(addr);
+}
+
+__EXTERN_INLINE void
+IO_CONCAT(__IO_PREFIX,writeb)(u8 b, volatile void __iomem *a)
+{
+       void __iomem *addr = (void __iomem *)a;
+       IO_CONCAT(__IO_PREFIX,iowrite8)(b, addr);
+}
+
+__EXTERN_INLINE void
+IO_CONCAT(__IO_PREFIX,writew)(u16 b, volatile void __iomem *a)
+{
+       void __iomem *addr = (void __iomem *)a;
+       IO_CONCAT(__IO_PREFIX,iowrite16)(b, addr);
+}
+#endif
+
+#if IO_CONCAT(__IO_PREFIX,trivial_rw_lq) == 1
+__EXTERN_INLINE u32
+IO_CONCAT(__IO_PREFIX,readl)(const volatile void __iomem *a)
+{
+       return *(const volatile u32 __force *)a;
+}
+
+__EXTERN_INLINE u64
+IO_CONCAT(__IO_PREFIX,readq)(const volatile void __iomem *a)
+{
+       return *(const volatile u64 __force *)a;
+}
+
+__EXTERN_INLINE void
+IO_CONCAT(__IO_PREFIX,writel)(u32 b, volatile void __iomem *a)
+{
+       *(volatile u32 __force *)a = b;
+}
+
+__EXTERN_INLINE void
+IO_CONCAT(__IO_PREFIX,writeq)(u64 b, volatile void __iomem *a)
+{
+       *(volatile u64 __force *)a = b;
+}
+#endif
+
+#if IO_CONCAT(__IO_PREFIX,trivial_iounmap)
+__EXTERN_INLINE void IO_CONCAT(__IO_PREFIX,iounmap)(volatile void __iomem *a)
+{
+}
+#endif
diff --git a/arch/alpha/include/asm/ioctl.h b/arch/alpha/include/asm/ioctl.h
new file mode 100644 (file)
index 0000000..fc63727
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef _ALPHA_IOCTL_H
+#define _ALPHA_IOCTL_H
+
+/*
+ * The original linux ioctl numbering scheme was just a general
+ * "anything goes" setup, where more or less random numbers were
+ * assigned.  Sorry, I was clueless when I started out on this.
+ *
+ * On the alpha, we'll try to clean it up a bit, using a more sane
+ * ioctl numbering, and also trying to be compatible with OSF/1 in
+ * the process. I'd like to clean it up for the i386 as well, but
+ * it's so painful recognizing both the new and the old numbers..
+ */
+
+#define _IOC_NRBITS    8
+#define _IOC_TYPEBITS  8
+#define _IOC_SIZEBITS  13
+#define _IOC_DIRBITS   3
+
+#define _IOC_NRMASK    ((1 << _IOC_NRBITS)-1)
+#define _IOC_TYPEMASK  ((1 << _IOC_TYPEBITS)-1)
+#define _IOC_SIZEMASK  ((1 << _IOC_SIZEBITS)-1)
+#define _IOC_DIRMASK   ((1 << _IOC_DIRBITS)-1)
+
+#define _IOC_NRSHIFT   0
+#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
+#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
+#define _IOC_DIRSHIFT  (_IOC_SIZESHIFT+_IOC_SIZEBITS)
+
+/*
+ * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit.
+ * And this turns out useful to catch old ioctl numbers in header
+ * files for us.
+ */
+#define _IOC_NONE      1U
+#define _IOC_READ      2U
+#define _IOC_WRITE     4U
+
+#define _IOC(dir,type,nr,size)                 \
+       ((unsigned int)                         \
+        (((dir)  << _IOC_DIRSHIFT) |           \
+         ((type) << _IOC_TYPESHIFT) |          \
+         ((nr)   << _IOC_NRSHIFT) |            \
+         ((size) << _IOC_SIZESHIFT)))
+
+/* used to create numbers */
+#define _IO(type,nr)           _IOC(_IOC_NONE,(type),(nr),0)
+#define _IOR(type,nr,size)     _IOC(_IOC_READ,(type),(nr),sizeof(size))
+#define _IOW(type,nr,size)     _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
+#define _IOWR(type,nr,size)    _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
+
+/* used to decode them.. */
+#define _IOC_DIR(nr)           (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
+#define _IOC_TYPE(nr)          (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
+#define _IOC_NR(nr)            (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
+#define _IOC_SIZE(nr)          (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
+
+/* ...and for the drivers/sound files... */
+
+#define IOC_IN         (_IOC_WRITE << _IOC_DIRSHIFT)
+#define IOC_OUT                (_IOC_READ << _IOC_DIRSHIFT)
+#define IOC_INOUT      ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
+#define IOCSIZE_MASK   (_IOC_SIZEMASK << _IOC_SIZESHIFT)
+#define IOCSIZE_SHIFT  (_IOC_SIZESHIFT)
+
+#endif /* _ALPHA_IOCTL_H */
diff --git a/arch/alpha/include/asm/ioctls.h b/arch/alpha/include/asm/ioctls.h
new file mode 100644 (file)
index 0000000..67bb9f6
--- /dev/null
@@ -0,0 +1,112 @@
+#ifndef _ASM_ALPHA_IOCTLS_H
+#define _ASM_ALPHA_IOCTLS_H
+
+#include <asm/ioctl.h>
+
+#define FIOCLEX                _IO('f', 1)
+#define FIONCLEX       _IO('f', 2)
+#define FIOASYNC       _IOW('f', 125, int)
+#define FIONBIO                _IOW('f', 126, int)
+#define FIONREAD       _IOR('f', 127, int)
+#define TIOCINQ                FIONREAD
+#define FIOQSIZE       _IOR('f', 128, loff_t)
+
+#define TIOCGETP       _IOR('t', 8, struct sgttyb)
+#define TIOCSETP       _IOW('t', 9, struct sgttyb)
+#define TIOCSETN       _IOW('t', 10, struct sgttyb)    /* TIOCSETP wo flush */
+
+#define TIOCSETC       _IOW('t', 17, struct tchars)
+#define TIOCGETC       _IOR('t', 18, struct tchars)
+#define TCGETS         _IOR('t', 19, struct termios)
+#define TCSETS         _IOW('t', 20, struct termios)
+#define TCSETSW                _IOW('t', 21, struct termios)
+#define TCSETSF                _IOW('t', 22, struct termios)
+
+#define TCGETA         _IOR('t', 23, struct termio)
+#define TCSETA         _IOW('t', 24, struct termio)
+#define TCSETAW                _IOW('t', 25, struct termio)
+#define TCSETAF                _IOW('t', 28, struct termio)
+
+#define TCSBRK         _IO('t', 29)
+#define TCXONC         _IO('t', 30)
+#define TCFLSH         _IO('t', 31)
+
+#define TIOCSWINSZ     _IOW('t', 103, struct winsize)
+#define TIOCGWINSZ     _IOR('t', 104, struct winsize)
+#define        TIOCSTART       _IO('t', 110)           /* start output, like ^Q */
+#define        TIOCSTOP        _IO('t', 111)           /* stop output, like ^S */
+#define TIOCOUTQ        _IOR('t', 115, int)     /* output queue size */
+
+#define TIOCGLTC       _IOR('t', 116, struct ltchars)
+#define TIOCSLTC       _IOW('t', 117, struct ltchars)
+#define TIOCSPGRP      _IOW('t', 118, int)
+#define TIOCGPGRP      _IOR('t', 119, int)
+
+#define TIOCEXCL       0x540C
+#define TIOCNXCL       0x540D
+#define TIOCSCTTY      0x540E
+
+#define TIOCSTI                0x5412
+#define TIOCMGET       0x5415
+#define TIOCMBIS       0x5416
+#define TIOCMBIC       0x5417
+#define TIOCMSET       0x5418
+# define TIOCM_LE      0x001
+# define TIOCM_DTR     0x002
+# define TIOCM_RTS     0x004
+# define TIOCM_ST      0x008
+# define TIOCM_SR      0x010
+# define TIOCM_CTS     0x020
+# define TIOCM_CAR     0x040
+# define TIOCM_RNG     0x080
+# define TIOCM_DSR     0x100
+# define TIOCM_CD      TIOCM_CAR
+# define TIOCM_RI      TIOCM_RNG
+# define TIOCM_OUT1    0x2000
+# define TIOCM_OUT2    0x4000
+# define TIOCM_LOOP    0x8000
+
+#define TIOCGSOFTCAR   0x5419
+#define TIOCSSOFTCAR   0x541A
+#define TIOCLINUX      0x541C
+#define TIOCCONS       0x541D
+#define TIOCGSERIAL    0x541E
+#define TIOCSSERIAL    0x541F
+#define TIOCPKT                0x5420
+# define TIOCPKT_DATA           0
+# define TIOCPKT_FLUSHREAD      1
+# define TIOCPKT_FLUSHWRITE     2
+# define TIOCPKT_STOP           4
+# define TIOCPKT_START          8
+# define TIOCPKT_NOSTOP                16
+# define TIOCPKT_DOSTOP                32
+
+
+#define TIOCNOTTY      0x5422
+#define TIOCSETD       0x5423
+#define TIOCGETD       0x5424
+#define TCSBRKP                0x5425  /* Needed for POSIX tcsendbreak() */
+#define TIOCSBRK       0x5427  /* BSD compatibility */
+#define TIOCCBRK       0x5428  /* BSD compatibility */
+#define TIOCGSID       0x5429  /* Return the session ID of FD */
+#define TIOCGPTN       _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK     _IOW('T',0x31, int)  /* Lock/unlock Pty */
+
+#define TIOCSERCONFIG  0x5453
+#define TIOCSERGWILD   0x5454
+#define TIOCSERSWILD   0x5455
+#define TIOCGLCKTRMIOS 0x5456
+#define TIOCSLCKTRMIOS 0x5457
+#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
+#define TIOCSERGETLSR   0x5459 /* Get line status register */
+  /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+# define TIOCSER_TEMT    0x01  /* Transmitter physically empty */
+#define TIOCSERGETMULTI 0x545A /* Get multiport config  */
+#define TIOCSERSETMULTI 0x545B /* Set multiport config */
+
+#define TIOCMIWAIT     0x545C  /* wait for a change on serial input line(s) */
+#define TIOCGICOUNT    0x545D  /* read serial port inline interrupt counts */
+#define TIOCGHAYESESP  0x545E  /* Get Hayes ESP configuration */
+#define TIOCSHAYESESP  0x545F  /* Set Hayes ESP configuration */
+
+#endif /* _ASM_ALPHA_IOCTLS_H */
diff --git a/arch/alpha/include/asm/ipcbuf.h b/arch/alpha/include/asm/ipcbuf.h
new file mode 100644 (file)
index 0000000..d9c0e1a
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef _ALPHA_IPCBUF_H
+#define _ALPHA_IPCBUF_H
+
+/* 
+ * The ipc64_perm structure for alpha architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 32-bit seq
+ * - 2 miscellaneous 64-bit values
+ */
+
+struct ipc64_perm
+{
+       __kernel_key_t  key;
+       __kernel_uid_t  uid;
+       __kernel_gid_t  gid;
+       __kernel_uid_t  cuid;
+       __kernel_gid_t  cgid;
+       __kernel_mode_t mode; 
+       unsigned short  seq;
+       unsigned short  __pad1;
+       unsigned long   __unused1;
+       unsigned long   __unused2;
+};
+
+#endif /* _ALPHA_IPCBUF_H */
diff --git a/arch/alpha/include/asm/irq.h b/arch/alpha/include/asm/irq.h
new file mode 100644 (file)
index 0000000..0637740
--- /dev/null
@@ -0,0 +1,91 @@
+#ifndef _ALPHA_IRQ_H
+#define _ALPHA_IRQ_H
+
+/*
+ *     linux/include/alpha/irq.h
+ *
+ *     (C) 1994 Linus Torvalds
+ */
+
+#include <linux/linkage.h>
+
+#if   defined(CONFIG_ALPHA_GENERIC)
+
+/* Here NR_IRQS is not exact, but rather an upper bound.  This is used
+   many places throughout the kernel to size static arrays.  That's ok,
+   we'll use alpha_mv.nr_irqs when we want the real thing.  */
+
+/* When LEGACY_START_ADDRESS is selected, we leave out:
+     TITAN
+     WILDFIRE
+     MARVEL
+
+   This helps keep the kernel object size reasonable for the majority
+   of machines.
+*/
+
+# if defined(CONFIG_ALPHA_LEGACY_START_ADDRESS)
+#  define NR_IRQS      (128)           /* max is RAWHIDE/TAKARA */
+# else
+#  define NR_IRQS      (32768 + 16)    /* marvel - 32 pids */
+# endif
+
+#elif defined(CONFIG_ALPHA_CABRIOLET) || \
+      defined(CONFIG_ALPHA_EB66P)     || \
+      defined(CONFIG_ALPHA_EB164)     || \
+      defined(CONFIG_ALPHA_PC164)     || \
+      defined(CONFIG_ALPHA_LX164)
+# define NR_IRQS       35
+
+#elif defined(CONFIG_ALPHA_EB66)      || \
+      defined(CONFIG_ALPHA_EB64P)     || \
+      defined(CONFIG_ALPHA_MIKASA)
+# define NR_IRQS       32
+
+#elif defined(CONFIG_ALPHA_ALCOR)     || \
+      defined(CONFIG_ALPHA_MIATA)     || \
+      defined(CONFIG_ALPHA_RUFFIAN)   || \
+      defined(CONFIG_ALPHA_RX164)     || \
+      defined(CONFIG_ALPHA_NORITAKE)
+# define NR_IRQS       48
+
+#elif defined(CONFIG_ALPHA_SABLE)     || \
+      defined(CONFIG_ALPHA_SX164)
+# define NR_IRQS       40
+
+#elif defined(CONFIG_ALPHA_DP264) || \
+      defined(CONFIG_ALPHA_LYNX)  || \
+      defined(CONFIG_ALPHA_SHARK) || \
+      defined(CONFIG_ALPHA_EIGER)
+# define NR_IRQS       64
+
+#elif defined(CONFIG_ALPHA_TITAN)
+#define NR_IRQS                80
+
+#elif defined(CONFIG_ALPHA_RAWHIDE) || \
+       defined(CONFIG_ALPHA_TAKARA)
+# define NR_IRQS       128
+
+#elif defined(CONFIG_ALPHA_WILDFIRE)
+# define NR_IRQS       2048 /* enuff for 8 QBBs */
+
+#elif defined(CONFIG_ALPHA_MARVEL)
+# define NR_IRQS       (32768 + 16)    /* marvel - 32 pids*/
+
+#else /* everyone else */
+# define NR_IRQS       16
+#endif
+
+static __inline__ int irq_canonicalize(int irq)
+{
+       /*
+        * XXX is this true for all Alpha's?  The old serial driver
+        * did it this way for years without any complaints, so....
+        */
+       return ((irq == 2) ? 9 : irq);
+}
+
+struct pt_regs;
+extern void (*perf_irq)(unsigned long, struct pt_regs *);
+
+#endif /* _ALPHA_IRQ_H */
diff --git a/arch/alpha/include/asm/irq_regs.h b/arch/alpha/include/asm/irq_regs.h
new file mode 100644 (file)
index 0000000..3dd9c0b
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/irq_regs.h>
diff --git a/arch/alpha/include/asm/jensen.h b/arch/alpha/include/asm/jensen.h
new file mode 100644 (file)
index 0000000..964b06e
--- /dev/null
@@ -0,0 +1,346 @@
+#ifndef __ALPHA_JENSEN_H
+#define __ALPHA_JENSEN_H
+
+#include <asm/compiler.h>
+
+/*
+ * Defines for the AlphaPC EISA IO and memory address space.
+ */
+
+/*
+ * NOTE! The memory operations do not set any memory barriers, as it's
+ * not needed for cases like a frame buffer that is essentially memory-like.
+ * You need to do them by hand if the operations depend on ordering.
+ *
+ * Similarly, the port IO operations do a "mb" only after a write operation:
+ * if an mb is needed before (as in the case of doing memory mapped IO
+ * first, and then a port IO operation to the same device), it needs to be
+ * done by hand.
+ *
+ * After the above has bitten me 100 times, I'll give up and just do the
+ * mb all the time, but right now I'm hoping this will work out.  Avoiding
+ * mb's may potentially be a noticeable speed improvement, but I can't
+ * honestly say I've tested it.
+ *
+ * Handling interrupts that need to do mb's to synchronize to non-interrupts
+ * is another fun race area.  Don't do it (because if you do, I'll have to
+ * do *everything* with interrupts disabled, ugh).
+ */
+
+/*
+ * EISA Interrupt Acknowledge address
+ */
+#define EISA_INTA              (IDENT_ADDR + 0x100000000UL)
+
+/*
+ * FEPROM addresses
+ */
+#define EISA_FEPROM0           (IDENT_ADDR + 0x180000000UL)
+#define EISA_FEPROM1           (IDENT_ADDR + 0x1A0000000UL)
+
+/*
+ * VL82C106 base address
+ */
+#define EISA_VL82C106          (IDENT_ADDR + 0x1C0000000UL)
+
+/*
+ * EISA "Host Address Extension" address (bits 25-31 of the EISA address)
+ */
+#define EISA_HAE               (IDENT_ADDR + 0x1D0000000UL)
+
+/*
+ * "SYSCTL" register address
+ */
+#define EISA_SYSCTL            (IDENT_ADDR + 0x1E0000000UL)
+
+/*
+ * "spare" register address
+ */
+#define EISA_SPARE             (IDENT_ADDR + 0x1F0000000UL)
+
+/*
+ * EISA memory address offset
+ */
+#define EISA_MEM               (IDENT_ADDR + 0x200000000UL)
+
+/*
+ * EISA IO address offset
+ */
+#define EISA_IO                        (IDENT_ADDR + 0x300000000UL)
+
+
+#ifdef __KERNEL__
+
+#ifndef __EXTERN_INLINE
+#define __EXTERN_INLINE extern inline
+#define __IO_EXTERN_INLINE
+#endif
+
+/*
+ * Handle the "host address register". This needs to be set
+ * to the high 7 bits of the EISA address.  This is also needed
+ * for EISA IO addresses, which are only 16 bits wide (the
+ * hae needs to be set to 0).
+ *
+ * HAE isn't needed for the local IO operations, though.
+ */
+
+#define JENSEN_HAE_ADDRESS     EISA_HAE
+#define JENSEN_HAE_MASK                0x1ffffff
+
+__EXTERN_INLINE void jensen_set_hae(unsigned long addr)
+{
+       /* hae on the Jensen is bits 31:25 shifted right */
+       addr >>= 25;
+       if (addr != alpha_mv.hae_cache)
+               set_hae(addr);
+}
+
+#define vuip   volatile unsigned int *
+
+/*
+ * IO functions
+ *
+ * The "local" functions are those that don't go out to the EISA bus,
+ * but instead act on the VL82C106 chip directly.. This is mainly the
+ * keyboard, RTC,  printer and first two serial lines..
+ *
+ * The local stuff makes for some complications, but it seems to be
+ * gone in the PCI version. I hope I can get DEC suckered^H^H^H^H^H^H^H^H
+ * convinced that I need one of the newer machines.
+ */
+
+static inline unsigned int jensen_local_inb(unsigned long addr)
+{
+       return 0xff & *(vuip)((addr << 9) + EISA_VL82C106);
+}
+
+static inline void jensen_local_outb(u8 b, unsigned long addr)
+{
+       *(vuip)((addr << 9) + EISA_VL82C106) = b;
+       mb();
+}
+
+static inline unsigned int jensen_bus_inb(unsigned long addr)
+{
+       long result;
+
+       jensen_set_hae(0);
+       result = *(volatile int *)((addr << 7) + EISA_IO + 0x00);
+       return __kernel_extbl(result, addr & 3);
+}
+
+static inline void jensen_bus_outb(u8 b, unsigned long addr)
+{
+       jensen_set_hae(0);
+       *(vuip)((addr << 7) + EISA_IO + 0x00) = b * 0x01010101;
+       mb();
+}
+
+/*
+ * It seems gcc is not very good at optimizing away logical
+ * operations that result in operations across inline functions.
+ * Which is why this is a macro.
+ */
+
+#define jensen_is_local(addr) ( \
+/* keyboard */ (addr == 0x60 || addr == 0x64) || \
+/* RTC */      (addr == 0x170 || addr == 0x171) || \
+/* mb COM2 */  (addr >= 0x2f8 && addr <= 0x2ff) || \
+/* mb LPT1 */  (addr >= 0x3bc && addr <= 0x3be) || \
+/* mb COM2 */  (addr >= 0x3f8 && addr <= 0x3ff))
+
+__EXTERN_INLINE u8 jensen_inb(unsigned long addr)
+{
+       if (jensen_is_local(addr))
+               return jensen_local_inb(addr);
+       else
+               return jensen_bus_inb(addr);
+}
+
+__EXTERN_INLINE void jensen_outb(u8 b, unsigned long addr)
+{
+       if (jensen_is_local(addr))
+               jensen_local_outb(b, addr);
+       else
+               jensen_bus_outb(b, addr);
+}
+
+__EXTERN_INLINE u16 jensen_inw(unsigned long addr)
+{
+       long result;
+
+       jensen_set_hae(0);
+       result = *(volatile int *) ((addr << 7) + EISA_IO + 0x20);
+       result >>= (addr & 3) * 8;
+       return 0xffffUL & result;
+}
+
+__EXTERN_INLINE u32 jensen_inl(unsigned long addr)
+{
+       jensen_set_hae(0);
+       return *(vuip) ((addr << 7) + EISA_IO + 0x60);
+}
+
+__EXTERN_INLINE void jensen_outw(u16 b, unsigned long addr)
+{
+       jensen_set_hae(0);
+       *(vuip) ((addr << 7) + EISA_IO + 0x20) = b * 0x00010001;
+       mb();
+}
+
+__EXTERN_INLINE void jensen_outl(u32 b, unsigned long addr)
+{
+       jensen_set_hae(0);
+       *(vuip) ((addr << 7) + EISA_IO + 0x60) = b;
+       mb();
+}
+
+/*
+ * Memory functions.
+ */
+
+__EXTERN_INLINE u8 jensen_readb(const volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       long result;
+
+       jensen_set_hae(addr);
+       addr &= JENSEN_HAE_MASK;
+       result = *(volatile int *) ((addr << 7) + EISA_MEM + 0x00);
+       result >>= (addr & 3) * 8;
+       return 0xffUL & result;
+}
+
+__EXTERN_INLINE u16 jensen_readw(const volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       long result;
+
+       jensen_set_hae(addr);
+       addr &= JENSEN_HAE_MASK;
+       result = *(volatile int *) ((addr << 7) + EISA_MEM + 0x20);
+       result >>= (addr & 3) * 8;
+       return 0xffffUL & result;
+}
+
+__EXTERN_INLINE u32 jensen_readl(const volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       jensen_set_hae(addr);
+       addr &= JENSEN_HAE_MASK;
+       return *(vuip) ((addr << 7) + EISA_MEM + 0x60);
+}
+
+__EXTERN_INLINE u64 jensen_readq(const volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       unsigned long r0, r1;
+
+       jensen_set_hae(addr);
+       addr &= JENSEN_HAE_MASK;
+       addr = (addr << 7) + EISA_MEM + 0x60;
+       r0 = *(vuip) (addr);
+       r1 = *(vuip) (addr + (4 << 7));
+       return r1 << 32 | r0;
+}
+
+__EXTERN_INLINE void jensen_writeb(u8 b, volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       jensen_set_hae(addr);
+       addr &= JENSEN_HAE_MASK;
+       *(vuip) ((addr << 7) + EISA_MEM + 0x00) = b * 0x01010101;
+}
+
+__EXTERN_INLINE void jensen_writew(u16 b, volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       jensen_set_hae(addr);
+       addr &= JENSEN_HAE_MASK;
+       *(vuip) ((addr << 7) + EISA_MEM + 0x20) = b * 0x00010001;
+}
+
+__EXTERN_INLINE void jensen_writel(u32 b, volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       jensen_set_hae(addr);
+       addr &= JENSEN_HAE_MASK;
+       *(vuip) ((addr << 7) + EISA_MEM + 0x60) = b;
+}
+
+__EXTERN_INLINE void jensen_writeq(u64 b, volatile void __iomem *xaddr)
+{
+       unsigned long addr = (unsigned long) xaddr;
+       jensen_set_hae(addr);
+       addr &= JENSEN_HAE_MASK;
+       addr = (addr << 7) + EISA_MEM + 0x60;
+       *(vuip) (addr) = b;
+       *(vuip) (addr + (4 << 7)) = b >> 32;
+}
+
+__EXTERN_INLINE void __iomem *jensen_ioportmap(unsigned long addr)
+{
+       return (void __iomem *)addr;
+}
+
+__EXTERN_INLINE void __iomem *jensen_ioremap(unsigned long addr,
+                                            unsigned long size)
+{
+       return (void __iomem *)(addr + 0x100000000ul);
+}
+
+__EXTERN_INLINE int jensen_is_ioaddr(unsigned long addr)
+{
+       return (long)addr >= 0;
+}
+
+__EXTERN_INLINE int jensen_is_mmio(const volatile void __iomem *addr)
+{
+       return (unsigned long)addr >= 0x100000000ul;
+}
+
+/* New-style ioread interface.  All the routines are so ugly for Jensen
+   that it doesn't make sense to merge them.  */
+
+#define IOPORT(OS, NS)                                                 \
+__EXTERN_INLINE unsigned int jensen_ioread##NS(void __iomem *xaddr)    \
+{                                                                      \
+       if (jensen_is_mmio(xaddr))                                      \
+               return jensen_read##OS(xaddr - 0x100000000ul);          \
+       else                                                            \
+               return jensen_in##OS((unsigned long)xaddr);             \
+}                                                                      \
+__EXTERN_INLINE void jensen_iowrite##NS(u##NS b, void __iomem *xaddr)  \
+{                                                                      \
+       if (jensen_is_mmio(xaddr))                                      \
+               jensen_write##OS(b, xaddr - 0x100000000ul);             \
+       else                                                            \
+               jensen_out##OS(b, (unsigned long)xaddr);                \
+}
+
+IOPORT(b, 8)
+IOPORT(w, 16)
+IOPORT(l, 32)
+
+#undef IOPORT
+
+#undef vuip
+
+#undef __IO_PREFIX
+#define __IO_PREFIX            jensen
+#define jensen_trivial_rw_bw   0
+#define jensen_trivial_rw_lq   0
+#define jensen_trivial_io_bw   0
+#define jensen_trivial_io_lq   0
+#define jensen_trivial_iounmap 1
+#include <asm/io_trivial.h>
+
+#ifdef __IO_EXTERN_INLINE
+#undef __EXTERN_INLINE
+#undef __IO_EXTERN_INLINE
+#endif
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_JENSEN_H */
diff --git a/arch/alpha/include/asm/kdebug.h b/arch/alpha/include/asm/kdebug.h
new file mode 100644 (file)
index 0000000..6ece1b0
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/kdebug.h>
diff --git a/arch/alpha/include/asm/kmap_types.h b/arch/alpha/include/asm/kmap_types.h
new file mode 100644 (file)
index 0000000..3e6735a
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef _ASM_KMAP_TYPES_H
+#define _ASM_KMAP_TYPES_H
+
+/* Dummy header just to define km_type. */
+
+
+#ifdef CONFIG_DEBUG_HIGHMEM
+# define D(n) __KM_FENCE_##n ,
+#else
+# define D(n)
+#endif
+
+enum km_type {
+D(0)   KM_BOUNCE_READ,
+D(1)   KM_SKB_SUNRPC_DATA,
+D(2)   KM_SKB_DATA_SOFTIRQ,
+D(3)   KM_USER0,
+D(4)   KM_USER1,
+D(5)   KM_BIO_SRC_IRQ,
+D(6)   KM_BIO_DST_IRQ,
+D(7)   KM_PTE0,
+D(8)   KM_PTE1,
+D(9)   KM_IRQ0,
+D(10)  KM_IRQ1,
+D(11)  KM_SOFTIRQ0,
+D(12)  KM_SOFTIRQ1,
+D(13)  KM_TYPE_NR
+};
+
+#undef D
+
+#endif
diff --git a/arch/alpha/include/asm/linkage.h b/arch/alpha/include/asm/linkage.h
new file mode 100644 (file)
index 0000000..291c2d0
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ASM_LINKAGE_H
+#define __ASM_LINKAGE_H
+
+/* Nothing to see here... */
+
+#endif
diff --git a/arch/alpha/include/asm/local.h b/arch/alpha/include/asm/local.h
new file mode 100644 (file)
index 0000000..6ad3ea6
--- /dev/null
@@ -0,0 +1,118 @@
+#ifndef _ALPHA_LOCAL_H
+#define _ALPHA_LOCAL_H
+
+#include <linux/percpu.h>
+#include <asm/atomic.h>
+
+typedef struct
+{
+       atomic_long_t a;
+} local_t;
+
+#define LOCAL_INIT(i)  { ATOMIC_LONG_INIT(i) }
+#define local_read(l)  atomic_long_read(&(l)->a)
+#define local_set(l,i) atomic_long_set(&(l)->a, (i))
+#define local_inc(l)   atomic_long_inc(&(l)->a)
+#define local_dec(l)   atomic_long_dec(&(l)->a)
+#define local_add(i,l) atomic_long_add((i),(&(l)->a))
+#define local_sub(i,l) atomic_long_sub((i),(&(l)->a))
+
+static __inline__ long local_add_return(long i, local_t * l)
+{
+       long temp, result;
+       __asm__ __volatile__(
+       "1:     ldq_l %0,%1\n"
+       "       addq %0,%3,%2\n"
+       "       addq %0,%3,%0\n"
+       "       stq_c %0,%1\n"
+       "       beq %0,2f\n"
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (l->a.counter), "=&r" (result)
+       :"Ir" (i), "m" (l->a.counter) : "memory");
+       return result;
+}
+
+static __inline__ long local_sub_return(long i, local_t * l)
+{
+       long temp, result;
+       __asm__ __volatile__(
+       "1:     ldq_l %0,%1\n"
+       "       subq %0,%3,%2\n"
+       "       subq %0,%3,%0\n"
+       "       stq_c %0,%1\n"
+       "       beq %0,2f\n"
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (l->a.counter), "=&r" (result)
+       :"Ir" (i), "m" (l->a.counter) : "memory");
+       return result;
+}
+
+#define local_cmpxchg(l, o, n) \
+       (cmpxchg_local(&((l)->a.counter), (o), (n)))
+#define local_xchg(l, n) (xchg_local(&((l)->a.counter), (n)))
+
+/**
+ * local_add_unless - add unless the number is a given value
+ * @l: pointer of type local_t
+ * @a: the amount to add to l...
+ * @u: ...unless l is equal to u.
+ *
+ * Atomically adds @a to @l, so long as it was not @u.
+ * Returns non-zero if @l was not @u, and zero otherwise.
+ */
+#define local_add_unless(l, a, u)                              \
+({                                                             \
+       long c, old;                                            \
+       c = local_read(l);                                      \
+       for (;;) {                                              \
+               if (unlikely(c == (u)))                         \
+                       break;                                  \
+               old = local_cmpxchg((l), c, c + (a));   \
+               if (likely(old == c))                           \
+                       break;                                  \
+               c = old;                                        \
+       }                                                       \
+       c != (u);                                               \
+})
+#define local_inc_not_zero(l) local_add_unless((l), 1, 0)
+
+#define local_add_negative(a, l) (local_add_return((a), (l)) < 0)
+
+#define local_dec_return(l) local_sub_return(1,(l))
+
+#define local_inc_return(l) local_add_return(1,(l))
+
+#define local_sub_and_test(i,l) (local_sub_return((i), (l)) == 0)
+
+#define local_inc_and_test(l) (local_add_return(1, (l)) == 0)
+
+#define local_dec_and_test(l) (local_sub_return(1, (l)) == 0)
+
+/* Verify if faster than atomic ops */
+#define __local_inc(l)         ((l)->a.counter++)
+#define __local_dec(l)         ((l)->a.counter++)
+#define __local_add(i,l)       ((l)->a.counter+=(i))
+#define __local_sub(i,l)       ((l)->a.counter-=(i))
+
+/* Use these for per-cpu local_t variables: on some archs they are
+ * much more efficient than these naive implementations.  Note they take
+ * a variable, not an address.
+ */
+#define cpu_local_read(l)      local_read(&__get_cpu_var(l))
+#define cpu_local_set(l, i)    local_set(&__get_cpu_var(l), (i))
+
+#define cpu_local_inc(l)       local_inc(&__get_cpu_var(l))
+#define cpu_local_dec(l)       local_dec(&__get_cpu_var(l))
+#define cpu_local_add(i, l)    local_add((i), &__get_cpu_var(l))
+#define cpu_local_sub(i, l)    local_sub((i), &__get_cpu_var(l))
+
+#define __cpu_local_inc(l)     __local_inc(&__get_cpu_var(l))
+#define __cpu_local_dec(l)     __local_dec(&__get_cpu_var(l))
+#define __cpu_local_add(i, l)  __local_add((i), &__get_cpu_var(l))
+#define __cpu_local_sub(i, l)  __local_sub((i), &__get_cpu_var(l))
+
+#endif /* _ALPHA_LOCAL_H */
diff --git a/arch/alpha/include/asm/machvec.h b/arch/alpha/include/asm/machvec.h
new file mode 100644 (file)
index 0000000..a86c083
--- /dev/null
@@ -0,0 +1,134 @@
+#ifndef __ALPHA_MACHVEC_H
+#define __ALPHA_MACHVEC_H 1
+
+#include <linux/types.h>
+
+/*
+ *     This file gets pulled in by asm/io.h from user space. We don't
+ *     want most of this escaping.
+ */
+#ifdef __KERNEL__
+
+/* The following structure vectors all of the I/O and IRQ manipulation
+   from the generic kernel to the hardware specific backend.  */
+
+struct task_struct;
+struct mm_struct;
+struct vm_area_struct;
+struct linux_hose_info;
+struct pci_dev;
+struct pci_ops;
+struct pci_controller;
+struct _alpha_agp_info;
+
+struct alpha_machine_vector
+{
+       /* This "belongs" down below with the rest of the runtime
+          variables, but it is convenient for entry.S if these 
+          two slots are at the beginning of the struct.  */
+       unsigned long hae_cache;
+       unsigned long *hae_register;
+
+       int nr_irqs;
+       int rtc_port;
+       unsigned int max_asn;
+       unsigned long max_isa_dma_address;
+       unsigned long irq_probe_mask;
+       unsigned long iack_sc;
+       unsigned long min_io_address;
+       unsigned long min_mem_address;
+       unsigned long pci_dac_offset;
+
+       void (*mv_pci_tbi)(struct pci_controller *hose,
+                          dma_addr_t start, dma_addr_t end);
+
+       unsigned int (*mv_ioread8)(void __iomem *);
+       unsigned int (*mv_ioread16)(void __iomem *);
+       unsigned int (*mv_ioread32)(void __iomem *);
+
+       void (*mv_iowrite8)(u8, void __iomem *);
+       void (*mv_iowrite16)(u16, void __iomem *);
+       void (*mv_iowrite32)(u32, void __iomem *);
+
+       u8 (*mv_readb)(const volatile void __iomem *);
+       u16 (*mv_readw)(const volatile void __iomem *);
+       u32 (*mv_readl)(const volatile void __iomem *);
+       u64 (*mv_readq)(const volatile void __iomem *);
+
+       void (*mv_writeb)(u8, volatile void __iomem *);
+       void (*mv_writew)(u16, volatile void __iomem *);
+       void (*mv_writel)(u32, volatile void __iomem *);
+       void (*mv_writeq)(u64, volatile void __iomem *);
+
+       void __iomem *(*mv_ioportmap)(unsigned long);
+       void __iomem *(*mv_ioremap)(unsigned long, unsigned long);
+       void (*mv_iounmap)(volatile void __iomem *);
+       int (*mv_is_ioaddr)(unsigned long);
+       int (*mv_is_mmio)(const volatile void __iomem *);
+
+       void (*mv_switch_mm)(struct mm_struct *, struct mm_struct *,
+                            struct task_struct *);
+       void (*mv_activate_mm)(struct mm_struct *, struct mm_struct *);
+
+       void (*mv_flush_tlb_current)(struct mm_struct *);
+       void (*mv_flush_tlb_current_page)(struct mm_struct * mm,
+                                         struct vm_area_struct *vma,
+                                         unsigned long addr);
+
+       void (*update_irq_hw)(unsigned long, unsigned long, int);
+       void (*ack_irq)(unsigned long);
+       void (*device_interrupt)(unsigned long vector);
+       void (*machine_check)(u64 vector, u64 la);
+
+       void (*smp_callin)(void);
+       void (*init_arch)(void);
+       void (*init_irq)(void);
+       void (*init_rtc)(void);
+       void (*init_pci)(void);
+       void (*kill_arch)(int);
+
+       u8 (*pci_swizzle)(struct pci_dev *, u8 *);
+       int (*pci_map_irq)(struct pci_dev *, u8, u8);
+       struct pci_ops *pci_ops;
+
+       struct _alpha_agp_info *(*agp_info)(void);
+
+       const char *vector_name;
+
+       /* NUMA information */
+       int (*pa_to_nid)(unsigned long);
+       int (*cpuid_to_nid)(int);
+       unsigned long (*node_mem_start)(int);
+       unsigned long (*node_mem_size)(int);
+
+       /* System specific parameters.  */
+       union {
+           struct {
+               unsigned long gru_int_req_bits;
+           } cia;
+
+           struct {
+               unsigned long gamma_bias;
+           } t2;
+
+           struct {
+               unsigned int route_tab;
+           } sio;
+       } sys;
+};
+
+extern struct alpha_machine_vector alpha_mv;
+
+#ifdef CONFIG_ALPHA_GENERIC
+extern int alpha_using_srm;
+#else
+#ifdef CONFIG_ALPHA_SRM
+#define alpha_using_srm 1
+#else
+#define alpha_using_srm 0
+#endif
+#endif /* GENERIC */
+
+#endif
+#endif /* __ALPHA_MACHVEC_H */
diff --git a/arch/alpha/include/asm/mc146818rtc.h b/arch/alpha/include/asm/mc146818rtc.h
new file mode 100644 (file)
index 0000000..097703f
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Machine dependent access functions for RTC registers.
+ */
+#ifndef __ASM_ALPHA_MC146818RTC_H
+#define __ASM_ALPHA_MC146818RTC_H
+
+#include <asm/io.h>
+
+#ifndef RTC_PORT
+#define RTC_PORT(x)    (0x70 + (x))
+#define RTC_ALWAYS_BCD 1       /* RTC operates in binary mode */
+#endif
+
+/*
+ * The yet supported machines all access the RTC index register via
+ * an ISA port access but the way to access the date register differs ...
+ */
+#define CMOS_READ(addr) ({ \
+outb_p((addr),RTC_PORT(0)); \
+inb_p(RTC_PORT(1)); \
+})
+#define CMOS_WRITE(val, addr) ({ \
+outb_p((addr),RTC_PORT(0)); \
+outb_p((val),RTC_PORT(1)); \
+})
+
+#endif /* __ASM_ALPHA_MC146818RTC_H */
diff --git a/arch/alpha/include/asm/md.h b/arch/alpha/include/asm/md.h
new file mode 100644 (file)
index 0000000..6c9b822
--- /dev/null
@@ -0,0 +1,13 @@
+/* $Id: md.h,v 1.1 1997/12/15 15:11:48 jj Exp $
+ * md.h: High speed xor_block operation for RAID4/5 
+ *
+ */
+#ifndef __ASM_MD_H
+#define __ASM_MD_H
+
+/* #define HAVE_ARCH_XORBLOCK */
+
+#define MD_XORBLOCK_ALIGNMENT  sizeof(long)
+
+#endif /* __ASM_MD_H */
diff --git a/arch/alpha/include/asm/mman.h b/arch/alpha/include/asm/mman.h
new file mode 100644 (file)
index 0000000..90d7c35
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef __ALPHA_MMAN_H__
+#define __ALPHA_MMAN_H__
+
+#define PROT_READ      0x1             /* page can be read */
+#define PROT_WRITE     0x2             /* page can be written */
+#define PROT_EXEC      0x4             /* page can be executed */
+#define PROT_SEM       0x8             /* page may be used for atomic ops */
+#define PROT_NONE      0x0             /* page can not be accessed */
+#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
+#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
+
+#define MAP_SHARED     0x01            /* Share changes */
+#define MAP_PRIVATE    0x02            /* Changes are private */
+#define MAP_TYPE       0x0f            /* Mask for type of mapping (OSF/1 is _wrong_) */
+#define MAP_FIXED      0x100           /* Interpret addr exactly */
+#define MAP_ANONYMOUS  0x10            /* don't use a file */
+
+/* not used by linux, but here to make sure we don't clash with OSF/1 defines */
+#define _MAP_HASSEMAPHORE 0x0200
+#define _MAP_INHERIT   0x0400
+#define _MAP_UNALIGNED 0x0800
+
+/* These are linux-specific */
+#define MAP_GROWSDOWN  0x01000         /* stack-like segment */
+#define MAP_DENYWRITE  0x02000         /* ETXTBSY */
+#define MAP_EXECUTABLE 0x04000         /* mark it as an executable */
+#define MAP_LOCKED     0x08000         /* lock the mapping */
+#define MAP_NORESERVE  0x10000         /* don't check for reservations */
+#define MAP_POPULATE   0x20000         /* populate (prefault) pagetables */
+#define MAP_NONBLOCK   0x40000         /* do not block on IO */
+
+#define MS_ASYNC       1               /* sync memory asynchronously */
+#define MS_SYNC                2               /* synchronous memory sync */
+#define MS_INVALIDATE  4               /* invalidate the caches */
+
+#define MCL_CURRENT     8192           /* lock all currently mapped pages */
+#define MCL_FUTURE     16384           /* lock all additions to address space */
+
+#define MADV_NORMAL    0               /* no further special treatment */
+#define MADV_RANDOM    1               /* expect random page references */
+#define MADV_SEQUENTIAL        2               /* expect sequential page references */
+#define MADV_WILLNEED  3               /* will need these pages */
+#define        MADV_SPACEAVAIL 5               /* ensure resources are available */
+#define MADV_DONTNEED  6               /* don't need these pages */
+
+/* common/generic parameters */
+#define MADV_REMOVE    9               /* remove these pages & resources */
+#define MADV_DONTFORK  10              /* don't inherit across fork */
+#define MADV_DOFORK    11              /* do inherit across fork */
+
+/* compatibility flags */
+#define MAP_FILE       0
+
+#endif /* __ALPHA_MMAN_H__ */
diff --git a/arch/alpha/include/asm/mmu.h b/arch/alpha/include/asm/mmu.h
new file mode 100644 (file)
index 0000000..3dc1277
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef __ALPHA_MMU_H
+#define __ALPHA_MMU_H
+
+/* The alpha MMU context is one "unsigned long" bitmap per CPU */
+typedef unsigned long mm_context_t[NR_CPUS];
+
+#endif
diff --git a/arch/alpha/include/asm/mmu_context.h b/arch/alpha/include/asm/mmu_context.h
new file mode 100644 (file)
index 0000000..86c08a0
--- /dev/null
@@ -0,0 +1,260 @@
+#ifndef __ALPHA_MMU_CONTEXT_H
+#define __ALPHA_MMU_CONTEXT_H
+
+/*
+ * get a new mmu context..
+ *
+ * Copyright (C) 1996, Linus Torvalds
+ */
+
+#include <asm/system.h>
+#include <asm/machvec.h>
+#include <asm/compiler.h>
+#include <asm-generic/mm_hooks.h>
+
+/*
+ * Force a context reload. This is needed when we change the page
+ * table pointer or when we update the ASN of the current process.
+ */
+
+/* Don't get into trouble with dueling __EXTERN_INLINEs.  */
+#ifndef __EXTERN_INLINE
+#include <asm/io.h>
+#endif
+
+
+static inline unsigned long
+__reload_thread(struct pcb_struct *pcb)
+{
+       register unsigned long a0 __asm__("$16");
+       register unsigned long v0 __asm__("$0");
+
+       a0 = virt_to_phys(pcb);
+       __asm__ __volatile__(
+               "call_pal %2 #__reload_thread"
+               : "=r"(v0), "=r"(a0)
+               : "i"(PAL_swpctx), "r"(a0)
+               : "$1", "$22", "$23", "$24", "$25");
+
+       return v0;
+}
+
+
+/*
+ * The maximum ASN's the processor supports.  On the EV4 this is 63
+ * but the PAL-code doesn't actually use this information.  On the
+ * EV5 this is 127, and EV6 has 255.
+ *
+ * On the EV4, the ASNs are more-or-less useless anyway, as they are
+ * only used as an icache tag, not for TB entries.  On the EV5 and EV6,
+ * ASN's also validate the TB entries, and thus make a lot more sense.
+ *
+ * The EV4 ASN's don't even match the architecture manual, ugh.  And
+ * I quote: "If a processor implements address space numbers (ASNs),
+ * and the old PTE has the Address Space Match (ASM) bit clear (ASNs
+ * in use) and the Valid bit set, then entries can also effectively be
+ * made coherent by assigning a new, unused ASN to the currently
+ * running process and not reusing the previous ASN before calling the
+ * appropriate PALcode routine to invalidate the translation buffer (TB)". 
+ *
+ * In short, the EV4 has a "kind of" ASN capability, but it doesn't actually
+ * work correctly and can thus not be used (explaining the lack of PAL-code
+ * support).
+ */
+#define EV4_MAX_ASN 63
+#define EV5_MAX_ASN 127
+#define EV6_MAX_ASN 255
+
+#ifdef CONFIG_ALPHA_GENERIC
+# define MAX_ASN       (alpha_mv.max_asn)
+#else
+# ifdef CONFIG_ALPHA_EV4
+#  define MAX_ASN      EV4_MAX_ASN
+# elif defined(CONFIG_ALPHA_EV5)
+#  define MAX_ASN      EV5_MAX_ASN
+# else
+#  define MAX_ASN      EV6_MAX_ASN
+# endif
+#endif
+
+/*
+ * cpu_last_asn(processor):
+ * 63                                            0
+ * +-------------+----------------+--------------+
+ * | asn version | this processor | hardware asn |
+ * +-------------+----------------+--------------+
+ */
+
+#include <asm/smp.h>
+#ifdef CONFIG_SMP
+#define cpu_last_asn(cpuid)    (cpu_data[cpuid].last_asn)
+#else
+extern unsigned long last_asn;
+#define cpu_last_asn(cpuid)    last_asn
+#endif /* CONFIG_SMP */
+
+#define WIDTH_HARDWARE_ASN     8
+#define ASN_FIRST_VERSION (1UL << WIDTH_HARDWARE_ASN)
+#define HARDWARE_ASN_MASK ((1UL << WIDTH_HARDWARE_ASN) - 1)
+
+/*
+ * NOTE! The way this is set up, the high bits of the "asn_cache" (and
+ * the "mm->context") are the ASN _version_ code. A version of 0 is
+ * always considered invalid, so to invalidate another process you only
+ * need to do "p->mm->context = 0".
+ *
+ * If we need more ASN's than the processor has, we invalidate the old
+ * user TLB's (tbiap()) and start a new ASN version. That will automatically
+ * force a new asn for any other processes the next time they want to
+ * run.
+ */
+
+#ifndef __EXTERN_INLINE
+#define __EXTERN_INLINE extern inline
+#define __MMU_EXTERN_INLINE
+#endif
+
+extern inline unsigned long
+__get_new_mm_context(struct mm_struct *mm, long cpu)
+{
+       unsigned long asn = cpu_last_asn(cpu);
+       unsigned long next = asn + 1;
+
+       if ((asn & HARDWARE_ASN_MASK) >= MAX_ASN) {
+               tbiap();
+               imb();
+               next = (asn & ~HARDWARE_ASN_MASK) + ASN_FIRST_VERSION;
+       }
+       cpu_last_asn(cpu) = next;
+       return next;
+}
+
+__EXTERN_INLINE void
+ev5_switch_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm,
+             struct task_struct *next)
+{
+       /* Check if our ASN is of an older version, and thus invalid. */
+       unsigned long asn;
+       unsigned long mmc;
+       long cpu = smp_processor_id();
+
+#ifdef CONFIG_SMP
+       cpu_data[cpu].asn_lock = 1;
+       barrier();
+#endif
+       asn = cpu_last_asn(cpu);
+       mmc = next_mm->context[cpu];
+       if ((mmc ^ asn) & ~HARDWARE_ASN_MASK) {
+               mmc = __get_new_mm_context(next_mm, cpu);
+               next_mm->context[cpu] = mmc;
+       }
+#ifdef CONFIG_SMP
+       else
+               cpu_data[cpu].need_new_asn = 1;
+#endif
+
+       /* Always update the PCB ASN.  Another thread may have allocated
+          a new mm->context (via flush_tlb_mm) without the ASN serial
+          number wrapping.  We have no way to detect when this is needed.  */
+       task_thread_info(next)->pcb.asn = mmc & HARDWARE_ASN_MASK;
+}
+
+__EXTERN_INLINE void
+ev4_switch_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm,
+             struct task_struct *next)
+{
+       /* As described, ASN's are broken for TLB usage.  But we can
+          optimize for switching between threads -- if the mm is
+          unchanged from current we needn't flush.  */
+       /* ??? May not be needed because EV4 PALcode recognizes that
+          ASN's are broken and does a tbiap itself on swpctx, under
+          the "Must set ASN or flush" rule.  At least this is true
+          for a 1992 SRM, reports Joseph Martin (jmartin@hlo.dec.com).
+          I'm going to leave this here anyway, just to Be Sure.  -- r~  */
+       if (prev_mm != next_mm)
+               tbiap();
+
+       /* Do continue to allocate ASNs, because we can still use them
+          to avoid flushing the icache.  */
+       ev5_switch_mm(prev_mm, next_mm, next);
+}
+
+extern void __load_new_mm_context(struct mm_struct *);
+
+#ifdef CONFIG_SMP
+#define check_mmu_context()                                    \
+do {                                                           \
+       int cpu = smp_processor_id();                           \
+       cpu_data[cpu].asn_lock = 0;                             \
+       barrier();                                              \
+       if (cpu_data[cpu].need_new_asn) {                       \
+               struct mm_struct * mm = current->active_mm;     \
+               cpu_data[cpu].need_new_asn = 0;                 \
+               if (!mm->context[cpu])                  \
+                       __load_new_mm_context(mm);              \
+       }                                                       \
+} while(0)
+#else
+#define check_mmu_context()  do { } while(0)
+#endif
+
+__EXTERN_INLINE void
+ev5_activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm)
+{
+       __load_new_mm_context(next_mm);
+}
+
+__EXTERN_INLINE void
+ev4_activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm)
+{
+       __load_new_mm_context(next_mm);
+       tbiap();
+}
+
+#define deactivate_mm(tsk,mm)  do { } while (0)
+
+#ifdef CONFIG_ALPHA_GENERIC
+# define switch_mm(a,b,c)      alpha_mv.mv_switch_mm((a),(b),(c))
+# define activate_mm(x,y)      alpha_mv.mv_activate_mm((x),(y))
+#else
+# ifdef CONFIG_ALPHA_EV4
+#  define switch_mm(a,b,c)     ev4_switch_mm((a),(b),(c))
+#  define activate_mm(x,y)     ev4_activate_mm((x),(y))
+# else
+#  define switch_mm(a,b,c)     ev5_switch_mm((a),(b),(c))
+#  define activate_mm(x,y)     ev5_activate_mm((x),(y))
+# endif
+#endif
+
+static inline int
+init_new_context(struct task_struct *tsk, struct mm_struct *mm)
+{
+       int i;
+
+       for_each_online_cpu(i)
+               mm->context[i] = 0;
+       if (tsk != current)
+               task_thread_info(tsk)->pcb.ptbr
+                 = ((unsigned long)mm->pgd - IDENT_ADDR) >> PAGE_SHIFT;
+       return 0;
+}
+
+extern inline void
+destroy_context(struct mm_struct *mm)
+{
+       /* Nothing to do.  */
+}
+
+static inline void
+enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
+{
+       task_thread_info(tsk)->pcb.ptbr
+         = ((unsigned long)mm->pgd - IDENT_ADDR) >> PAGE_SHIFT;
+}
+
+#ifdef __MMU_EXTERN_INLINE
+#undef __EXTERN_INLINE
+#undef __MMU_EXTERN_INLINE
+#endif
+
+#endif /* __ALPHA_MMU_CONTEXT_H */
diff --git a/arch/alpha/include/asm/mmzone.h b/arch/alpha/include/asm/mmzone.h
new file mode 100644 (file)
index 0000000..8af56ce
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Written by Kanoj Sarcar (kanoj@sgi.com) Aug 99
+ * Adapted for the alpha wildfire architecture Jan 2001.
+ */
+#ifndef _ASM_MMZONE_H_
+#define _ASM_MMZONE_H_
+
+#include <asm/smp.h>
+
+struct bootmem_data_t; /* stupid forward decl. */
+
+/*
+ * Following are macros that are specific to this numa platform.
+ */
+
+extern pg_data_t node_data[];
+
+#define alpha_pa_to_nid(pa)            \
+        (alpha_mv.pa_to_nid            \
+        ? alpha_mv.pa_to_nid(pa)       \
+        : (0))
+#define node_mem_start(nid)            \
+        (alpha_mv.node_mem_start       \
+        ? alpha_mv.node_mem_start(nid) \
+        : (0UL))
+#define node_mem_size(nid)             \
+        (alpha_mv.node_mem_size        \
+        ? alpha_mv.node_mem_size(nid)  \
+        : ((nid) ? (0UL) : (~0UL)))
+
+#define pa_to_nid(pa)          alpha_pa_to_nid(pa)
+#define NODE_DATA(nid)         (&node_data[(nid)])
+
+#define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn)
+
+#if 1
+#define PLAT_NODE_DATA_LOCALNR(p, n)   \
+       (((p) >> PAGE_SHIFT) - PLAT_NODE_DATA(n)->gendata.node_start_pfn)
+#else
+static inline unsigned long
+PLAT_NODE_DATA_LOCALNR(unsigned long p, int n)
+{
+       unsigned long temp;
+       temp = p >> PAGE_SHIFT;
+       return temp - PLAT_NODE_DATA(n)->gendata.node_start_pfn;
+}
+#endif
+
+#ifdef CONFIG_DISCONTIGMEM
+
+/*
+ * Following are macros that each numa implementation must define.
+ */
+
+/*
+ * Given a kernel address, find the home node of the underlying memory.
+ */
+#define kvaddr_to_nid(kaddr)   pa_to_nid(__pa(kaddr))
+#define node_start_pfn(nid)    (NODE_DATA(nid)->node_start_pfn)
+
+/*
+ * Given a kaddr, LOCAL_BASE_ADDR finds the owning node of the memory
+ * and returns the kaddr corresponding to first physical page in the
+ * node's mem_map.
+ */
+#define LOCAL_BASE_ADDR(kaddr)                                           \
+    ((unsigned long)__va(NODE_DATA(kvaddr_to_nid(kaddr))->node_start_pfn  \
+                        << PAGE_SHIFT))
+
+/* XXX: FIXME -- wli */
+#define kern_addr_valid(kaddr) (0)
+
+#define virt_to_page(kaddr)    pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
+
+#define VALID_PAGE(page)       (((page) - mem_map) < max_mapnr)
+
+#define pmd_page(pmd)          (pfn_to_page(pmd_val(pmd) >> 32))
+#define pgd_page(pgd)          (pfn_to_page(pgd_val(pgd) >> 32))
+#define pte_pfn(pte)           (pte_val(pte) >> 32)
+
+#define mk_pte(page, pgprot)                                                \
+({                                                                          \
+       pte_t pte;                                                           \
+       unsigned long pfn;                                                   \
+                                                                            \
+       pfn = page_to_pfn(page) << 32; \
+       pte_val(pte) = pfn | pgprot_val(pgprot);                             \
+                                                                            \
+       pte;                                                                 \
+})
+
+#define pte_page(x)                                                    \
+({                                                                     \
+               unsigned long kvirt;                                            \
+       struct page * __xx;                                             \
+                                                                       \
+       kvirt = (unsigned long)__va(pte_val(x) >> (32-PAGE_SHIFT));     \
+       __xx = virt_to_page(kvirt);                                     \
+                                                                       \
+       __xx;                                                           \
+})
+
+#define page_to_pa(page)                                               \
+       (page_to_pfn(page) << PAGE_SHIFT)
+
+#define pfn_to_nid(pfn)                pa_to_nid(((u64)(pfn) << PAGE_SHIFT))
+#define pfn_valid(pfn)                                                 \
+       (((pfn) - node_start_pfn(pfn_to_nid(pfn))) <                    \
+        node_spanned_pages(pfn_to_nid(pfn)))                                   \
+
+#define virt_addr_valid(kaddr) pfn_valid((__pa(kaddr) >> PAGE_SHIFT))
+
+#endif /* CONFIG_DISCONTIGMEM */
+
+#endif /* _ASM_MMZONE_H_ */
diff --git a/arch/alpha/include/asm/module.h b/arch/alpha/include/asm/module.h
new file mode 100644 (file)
index 0000000..7b63743
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef _ALPHA_MODULE_H
+#define _ALPHA_MODULE_H
+
+struct mod_arch_specific
+{
+       unsigned int gotsecindex;
+};
+
+#define Elf_Sym Elf64_Sym
+#define Elf_Shdr Elf64_Shdr
+#define Elf_Ehdr Elf64_Ehdr
+#define Elf_Phdr Elf64_Phdr
+#define Elf_Dyn Elf64_Dyn
+#define Elf_Rel Elf64_Rel
+#define Elf_Rela Elf64_Rela
+
+#define ARCH_SHF_SMALL SHF_ALPHA_GPREL
+
+#ifdef MODULE
+asm(".section .got,\"aws\",@progbits; .align 3; .previous");
+#endif
+
+#endif /*_ALPHA_MODULE_H*/
diff --git a/arch/alpha/include/asm/msgbuf.h b/arch/alpha/include/asm/msgbuf.h
new file mode 100644 (file)
index 0000000..9849650
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef _ALPHA_MSGBUF_H
+#define _ALPHA_MSGBUF_H
+
+/* 
+ * The msqid64_ds structure for alpha architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 2 miscellaneous 64-bit values
+ */
+
+struct msqid64_ds {
+       struct ipc64_perm msg_perm;
+       __kernel_time_t msg_stime;      /* last msgsnd time */
+       __kernel_time_t msg_rtime;      /* last msgrcv time */
+       __kernel_time_t msg_ctime;      /* last change time */
+       unsigned long  msg_cbytes;      /* current number of bytes on queue */
+       unsigned long  msg_qnum;        /* number of messages in queue */
+       unsigned long  msg_qbytes;      /* max number of bytes on queue */
+       __kernel_pid_t msg_lspid;       /* pid of last msgsnd */
+       __kernel_pid_t msg_lrpid;       /* last receive pid */
+       unsigned long  __unused1;
+       unsigned long  __unused2;
+};
+
+#endif /* _ALPHA_MSGBUF_H */
diff --git a/arch/alpha/include/asm/mutex.h b/arch/alpha/include/asm/mutex.h
new file mode 100644 (file)
index 0000000..458c1f7
--- /dev/null
@@ -0,0 +1,9 @@
+/*
+ * Pull in the generic implementation for the mutex fastpath.
+ *
+ * TODO: implement optimized primitives instead, or leave the generic
+ * implementation in place, or pick the atomic_xchg() based generic
+ * implementation. (see asm-generic/mutex-xchg.h for details)
+ */
+
+#include <asm-generic/mutex-dec.h>
diff --git a/arch/alpha/include/asm/page.h b/arch/alpha/include/asm/page.h
new file mode 100644 (file)
index 0000000..0995f9d
--- /dev/null
@@ -0,0 +1,98 @@
+#ifndef _ALPHA_PAGE_H
+#define _ALPHA_PAGE_H
+
+#include <linux/const.h>
+#include <asm/pal.h>
+
+/* PAGE_SHIFT determines the page size */
+#define PAGE_SHIFT     13
+#define PAGE_SIZE      (_AC(1,UL) << PAGE_SHIFT)
+#define PAGE_MASK      (~(PAGE_SIZE-1))
+
+#ifndef __ASSEMBLY__
+
+#define STRICT_MM_TYPECHECKS
+
+extern void clear_page(void *page);
+#define clear_user_page(page, vaddr, pg)       clear_page(page)
+
+#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
+       alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vmaddr)
+#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
+
+extern void copy_page(void * _to, void * _from);
+#define copy_user_page(to, from, vaddr, pg)    copy_page(to, from)
+
+#ifdef STRICT_MM_TYPECHECKS
+/*
+ * These are used to make use of C type-checking..
+ */
+typedef struct { unsigned long pte; } pte_t;
+typedef struct { unsigned long pmd; } pmd_t;
+typedef struct { unsigned long pgd; } pgd_t;
+typedef struct { unsigned long pgprot; } pgprot_t;
+
+#define pte_val(x)     ((x).pte)
+#define pmd_val(x)     ((x).pmd)
+#define pgd_val(x)     ((x).pgd)
+#define pgprot_val(x)  ((x).pgprot)
+
+#define __pte(x)       ((pte_t) { (x) } )
+#define __pmd(x)       ((pmd_t) { (x) } )
+#define __pgd(x)       ((pgd_t) { (x) } )
+#define __pgprot(x)    ((pgprot_t) { (x) } )
+
+#else
+/*
+ * .. while these make it easier on the compiler
+ */
+typedef unsigned long pte_t;
+typedef unsigned long pmd_t;
+typedef unsigned long pgd_t;
+typedef unsigned long pgprot_t;
+
+#define pte_val(x)     (x)
+#define pmd_val(x)     (x)
+#define pgd_val(x)     (x)
+#define pgprot_val(x)  (x)
+
+#define __pte(x)       (x)
+#define __pgd(x)       (x)
+#define __pgprot(x)    (x)
+
+#endif /* STRICT_MM_TYPECHECKS */
+
+typedef struct page *pgtable_t;
+
+#ifdef USE_48_BIT_KSEG
+#define PAGE_OFFSET            0xffff800000000000UL
+#else
+#define PAGE_OFFSET            0xfffffc0000000000UL
+#endif
+
+#else
+
+#ifdef USE_48_BIT_KSEG
+#define PAGE_OFFSET            0xffff800000000000
+#else
+#define PAGE_OFFSET            0xfffffc0000000000
+#endif
+
+#endif /* !__ASSEMBLY__ */
+
+#define __pa(x)                        ((unsigned long) (x) - PAGE_OFFSET)
+#define __va(x)                        ((void *)((unsigned long) (x) + PAGE_OFFSET))
+#ifndef CONFIG_DISCONTIGMEM
+#define virt_to_page(kaddr)    pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
+
+#define pfn_valid(pfn)         ((pfn) < max_mapnr)
+#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
+#endif /* CONFIG_DISCONTIGMEM */
+
+#define VM_DATA_DEFAULT_FLAGS          (VM_READ | VM_WRITE | VM_EXEC | \
+                                        VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+
+#include <asm-generic/memory_model.h>
+#include <asm-generic/page.h>
+
+#endif /* _ALPHA_PAGE_H */
diff --git a/arch/alpha/include/asm/pal.h b/arch/alpha/include/asm/pal.h
new file mode 100644 (file)
index 0000000..9b4ba0d
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef __ALPHA_PAL_H
+#define __ALPHA_PAL_H
+
+/*
+ * Common PAL-code
+ */
+#define PAL_halt         0
+#define PAL_cflush       1
+#define PAL_draina       2
+#define PAL_bpt                128
+#define PAL_bugchk     129
+#define PAL_chmk       131
+#define PAL_callsys    131
+#define PAL_imb                134
+#define PAL_rduniq     158
+#define PAL_wruniq     159
+#define PAL_gentrap    170
+#define PAL_nphalt     190
+
+/*
+ * VMS specific PAL-code
+ */
+#define PAL_swppal     10
+#define PAL_mfpr_vptb  41
+
+/*
+ * OSF specific PAL-code
+ */
+#define PAL_cserve      9
+#define PAL_wripir     13
+#define PAL_rdmces     16
+#define PAL_wrmces     17
+#define PAL_wrfen      43
+#define PAL_wrvptptr   45
+#define PAL_jtopal     46
+#define PAL_swpctx     48
+#define PAL_wrval      49
+#define PAL_rdval      50
+#define PAL_tbi                51
+#define PAL_wrent      52
+#define PAL_swpipl     53
+#define PAL_rdps       54
+#define PAL_wrkgp      55
+#define PAL_wrusp      56
+#define PAL_wrperfmon  57
+#define PAL_rdusp      58
+#define PAL_whami      60
+#define PAL_retsys     61
+#define PAL_rti                63
+
+#endif /* __ALPHA_PAL_H */
diff --git a/arch/alpha/include/asm/param.h b/arch/alpha/include/asm/param.h
new file mode 100644 (file)
index 0000000..e691ecf
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef _ASM_ALPHA_PARAM_H
+#define _ASM_ALPHA_PARAM_H
+
+/* ??? Gross.  I don't want to parameterize this, and supposedly the
+   hardware ignores reprogramming.  We also need userland buy-in to the 
+   change in HZ, since this is visible in the wait4 resources etc.  */
+
+#ifdef __KERNEL__
+#define HZ             CONFIG_HZ
+#define USER_HZ                HZ
+#else
+#define HZ             1024
+#endif
+
+#define EXEC_PAGESIZE  8192
+
+#ifndef NOGROUP
+#define NOGROUP                (-1)
+#endif
+
+#define MAXHOSTNAMELEN 64      /* max length of hostname */
+
+#ifdef __KERNEL__
+# define CLOCKS_PER_SEC        HZ      /* frequency at which times() counts */
+#endif
+
+#endif /* _ASM_ALPHA_PARAM_H */
diff --git a/arch/alpha/include/asm/parport.h b/arch/alpha/include/asm/parport.h
new file mode 100644 (file)
index 0000000..c5ee7cb
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * parport.h: platform-specific PC-style parport initialisation
+ *
+ * Copyright (C) 1999, 2000  Tim Waugh <tim@cyberelk.demon.co.uk>
+ *
+ * This file should only be included by drivers/parport/parport_pc.c.
+ */
+
+#ifndef _ASM_AXP_PARPORT_H
+#define _ASM_AXP_PARPORT_H 1
+
+static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
+static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
+{
+       return parport_pc_find_isa_ports (autoirq, autodma);
+}
+
+#endif /* !(_ASM_AXP_PARPORT_H) */
diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h
new file mode 100644 (file)
index 0000000..2a14302
--- /dev/null
@@ -0,0 +1,276 @@
+#ifndef __ALPHA_PCI_H
+#define __ALPHA_PCI_H
+
+#ifdef __KERNEL__
+
+#include <linux/spinlock.h>
+#include <linux/dma-mapping.h>
+#include <asm/scatterlist.h>
+#include <asm/machvec.h>
+
+/*
+ * The following structure is used to manage multiple PCI busses.
+ */
+
+struct pci_dev;
+struct pci_bus;
+struct resource;
+struct pci_iommu_arena;
+struct page;
+
+/* A controller.  Used to manage multiple PCI busses.  */
+
+struct pci_controller {
+       struct pci_controller *next;
+        struct pci_bus *bus;
+       struct resource *io_space;
+       struct resource *mem_space;
+
+       /* The following are for reporting to userland.  The invariant is
+          that if we report a BWX-capable dense memory, we do not report
+          a sparse memory at all, even if it exists.  */
+       unsigned long sparse_mem_base;
+       unsigned long dense_mem_base;
+       unsigned long sparse_io_base;
+       unsigned long dense_io_base;
+
+       /* This one's for the kernel only.  It's in KSEG somewhere.  */
+       unsigned long config_space_base;
+
+       unsigned int index;
+       /* For compatibility with current (as of July 2003) pciutils
+          and XFree86. Eventually will be removed. */
+       unsigned int need_domain_info;
+
+       struct pci_iommu_arena *sg_pci;
+       struct pci_iommu_arena *sg_isa;
+
+       void *sysdata;
+};
+
+/* Override the logic in pci_scan_bus for skipping already-configured
+   bus numbers.  */
+
+#define pcibios_assign_all_busses()    1
+#define pcibios_scan_all_fns(a, b)     0
+
+#define PCIBIOS_MIN_IO         alpha_mv.min_io_address
+#define PCIBIOS_MIN_MEM                alpha_mv.min_mem_address
+
+extern void pcibios_set_master(struct pci_dev *dev);
+
+extern inline void pcibios_penalize_isa_irq(int irq, int active)
+{
+       /* We don't do dynamic PCI IRQ allocation */
+}
+
+/* IOMMU controls.  */
+
+/* The PCI address space does not equal the physical memory address space.
+   The networking and block device layers use this boolean for bounce buffer
+   decisions.  */
+#define PCI_DMA_BUS_IS_PHYS  0
+
+/* Allocate and map kernel buffer using consistent mode DMA for PCI
+   device.  Returns non-NULL cpu-view pointer to the buffer if
+   successful and sets *DMA_ADDRP to the pci side dma address as well,
+   else DMA_ADDRP is undefined.  */
+
+extern void *__pci_alloc_consistent(struct pci_dev *, size_t,
+                                   dma_addr_t *, gfp_t);
+static inline void *
+pci_alloc_consistent(struct pci_dev *dev, size_t size, dma_addr_t *dma)
+{
+       return __pci_alloc_consistent(dev, size, dma, GFP_ATOMIC);
+}
+
+/* Free and unmap a consistent DMA buffer.  CPU_ADDR and DMA_ADDR must
+   be values that were returned from pci_alloc_consistent.  SIZE must
+   be the same as what as passed into pci_alloc_consistent.
+   References to the memory and mappings associated with CPU_ADDR or
+   DMA_ADDR past this call are illegal.  */
+
+extern void pci_free_consistent(struct pci_dev *, size_t, void *, dma_addr_t);
+
+/* Map a single buffer of the indicate size for PCI DMA in streaming mode.
+   The 32-bit PCI bus mastering address to use is returned.  Once the device
+   is given the dma address, the device owns this memory until either
+   pci_unmap_single or pci_dma_sync_single_for_cpu is performed.  */
+
+extern dma_addr_t pci_map_single(struct pci_dev *, void *, size_t, int);
+
+/* Likewise, but for a page instead of an address.  */
+extern dma_addr_t pci_map_page(struct pci_dev *, struct page *,
+                              unsigned long, size_t, int);
+
+/* Test for pci_map_single or pci_map_page having generated an error.  */
+
+static inline int
+pci_dma_mapping_error(struct pci_dev *pdev, dma_addr_t dma_addr)
+{
+       return dma_addr == 0;
+}
+
+/* Unmap a single streaming mode DMA translation.  The DMA_ADDR and
+   SIZE must match what was provided for in a previous pci_map_single
+   call.  All other usages are undefined.  After this call, reads by
+   the cpu to the buffer are guaranteed to see whatever the device
+   wrote there.  */
+
+extern void pci_unmap_single(struct pci_dev *, dma_addr_t, size_t, int);
+extern void pci_unmap_page(struct pci_dev *, dma_addr_t, size_t, int);
+
+/* pci_unmap_{single,page} is not a nop, thus... */
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)      \
+       dma_addr_t ADDR_NAME;
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)                \
+       __u32 LEN_NAME;
+#define pci_unmap_addr(PTR, ADDR_NAME)                 \
+       ((PTR)->ADDR_NAME)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL)                \
+       (((PTR)->ADDR_NAME) = (VAL))
+#define pci_unmap_len(PTR, LEN_NAME)                   \
+       ((PTR)->LEN_NAME)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL)          \
+       (((PTR)->LEN_NAME) = (VAL))
+
+/* Map a set of buffers described by scatterlist in streaming mode for
+   PCI DMA.  This is the scatter-gather version of the above
+   pci_map_single interface.  Here the scatter gather list elements
+   are each tagged with the appropriate PCI dma address and length.
+   They are obtained via sg_dma_{address,length}(SG).
+
+   NOTE: An implementation may be able to use a smaller number of DMA
+   address/length pairs than there are SG table elements.  (for
+   example via virtual mapping capabilities) The routine returns the
+   number of addr/length pairs actually used, at most nents.
+
+   Device ownership issues as mentioned above for pci_map_single are
+   the same here.  */
+
+extern int pci_map_sg(struct pci_dev *, struct scatterlist *, int, int);
+
+/* Unmap a set of streaming mode DMA translations.  Again, cpu read
+   rules concerning calls here are the same as for pci_unmap_single()
+   above.  */
+
+extern void pci_unmap_sg(struct pci_dev *, struct scatterlist *, int, int);
+
+/* Make physical memory consistent for a single streaming mode DMA
+   translation after a transfer and device currently has ownership
+   of the buffer.
+
+   If you perform a pci_map_single() but wish to interrogate the
+   buffer using the cpu, yet do not wish to teardown the PCI dma
+   mapping, you must call this function before doing so.  At the next
+   point you give the PCI dma address back to the card, you must first
+   perform a pci_dma_sync_for_device, and then the device again owns
+   the buffer.  */
+
+static inline void
+pci_dma_sync_single_for_cpu(struct pci_dev *dev, dma_addr_t dma_addr,
+                           long size, int direction)
+{
+       /* Nothing to do.  */
+}
+
+static inline void
+pci_dma_sync_single_for_device(struct pci_dev *dev, dma_addr_t dma_addr,
+                              size_t size, int direction)
+{
+       /* Nothing to do.  */
+}
+
+/* Make physical memory consistent for a set of streaming mode DMA
+   translations after a transfer.  The same as pci_dma_sync_single_*
+   but for a scatter-gather list, same rules and usage.  */
+
+static inline void
+pci_dma_sync_sg_for_cpu(struct pci_dev *dev, struct scatterlist *sg,
+                       int nents, int direction)
+{
+       /* Nothing to do.  */
+}
+
+static inline void
+pci_dma_sync_sg_for_device(struct pci_dev *dev, struct scatterlist *sg,
+                          int nents, int direction)
+{
+       /* Nothing to do.  */
+}
+
+/* Return whether the given PCI device DMA address mask can
+   be supported properly.  For example, if your device can
+   only drive the low 24-bits during PCI bus mastering, then
+   you would pass 0x00ffffff as the mask to this function.  */
+
+extern int pci_dma_supported(struct pci_dev *hwdev, u64 mask);
+
+#ifdef CONFIG_PCI
+static inline void pci_dma_burst_advice(struct pci_dev *pdev,
+                                       enum pci_dma_burst_strategy *strat,
+                                       unsigned long *strategy_parameter)
+{
+       unsigned long cacheline_size;
+       u8 byte;
+
+       pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &byte);
+       if (byte == 0)
+               cacheline_size = 1024;
+       else
+               cacheline_size = (int) byte * 4;
+
+       *strat = PCI_DMA_BURST_BOUNDARY;
+       *strategy_parameter = cacheline_size;
+}
+#endif
+
+/* TODO: integrate with include/asm-generic/pci.h ? */
+static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
+{
+       return channel ? 15 : 14;
+}
+
+extern void pcibios_resource_to_bus(struct pci_dev *, struct pci_bus_region *,
+                                   struct resource *);
+
+extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
+                                   struct pci_bus_region *region);
+
+static inline struct resource *
+pcibios_select_root(struct pci_dev *pdev, struct resource *res)
+{
+       struct resource *root = NULL;
+
+       if (res->flags & IORESOURCE_IO)
+               root = &ioport_resource;
+       if (res->flags & IORESOURCE_MEM)
+               root = &iomem_resource;
+
+       return root;
+}
+
+#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
+
+static inline int pci_proc_domain(struct pci_bus *bus)
+{
+       struct pci_controller *hose = bus->sysdata;
+       return hose->need_domain_info;
+}
+
+struct pci_dev *alpha_gendev_to_pci(struct device *dev);
+
+#endif /* __KERNEL__ */
+
+/* Values for the `which' argument to sys_pciconfig_iobase.  */
+#define IOBASE_HOSE            0
+#define IOBASE_SPARSE_MEM      1
+#define IOBASE_DENSE_MEM       2
+#define IOBASE_SPARSE_IO       3
+#define IOBASE_DENSE_IO                4
+#define IOBASE_ROOT_BUS                5
+#define IOBASE_FROM_HOSE       0x10000
+
+extern struct pci_dev *isa_bridge;
+
+#endif /* __ALPHA_PCI_H */
diff --git a/arch/alpha/include/asm/percpu.h b/arch/alpha/include/asm/percpu.h
new file mode 100644 (file)
index 0000000..3495e8e
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef __ALPHA_PERCPU_H
+#define __ALPHA_PERCPU_H
+#include <linux/compiler.h>
+#include <linux/threads.h>
+
+/*
+ * Determine the real variable name from the name visible in the
+ * kernel sources.
+ */
+#define per_cpu_var(var) per_cpu__##var
+
+#ifdef CONFIG_SMP
+
+/*
+ * per_cpu_offset() is the offset that has to be added to a
+ * percpu variable to get to the instance for a certain processor.
+ */
+extern unsigned long __per_cpu_offset[NR_CPUS];
+
+#define per_cpu_offset(x) (__per_cpu_offset[x])
+
+#define __my_cpu_offset per_cpu_offset(raw_smp_processor_id())
+#ifdef CONFIG_DEBUG_PREEMPT
+#define my_cpu_offset per_cpu_offset(smp_processor_id())
+#else
+#define my_cpu_offset __my_cpu_offset
+#endif
+
+#ifndef MODULE
+#define SHIFT_PERCPU_PTR(var, offset) RELOC_HIDE(&per_cpu_var(var), (offset))
+#define PER_CPU_ATTRIBUTES
+#else
+/*
+ * To calculate addresses of locally defined variables, GCC uses 32-bit
+ * displacement from the GP. Which doesn't work for per cpu variables in
+ * modules, as an offset to the kernel per cpu area is way above 4G.
+ *
+ * This forces allocation of a GOT entry for per cpu variable using
+ * ldq instruction with a 'literal' relocation.
+ */
+#define SHIFT_PERCPU_PTR(var, offset) ({               \
+       extern int simple_identifier_##var(void);       \
+       unsigned long __ptr, tmp_gp;                    \
+       asm (  "br      %1, 1f                        \n\
+       1:      ldgp    %1, 0(%1)                     \n\
+               ldq %0, per_cpu__" #var"(%1)\t!literal"         \
+               : "=&r"(__ptr), "=&r"(tmp_gp));         \
+       (typeof(&per_cpu_var(var)))(__ptr + (offset)); })
+
+#define PER_CPU_ATTRIBUTES     __used
+
+#endif /* MODULE */
+
+/*
+ * A percpu variable may point to a discarded regions. The following are
+ * established ways to produce a usable pointer from the percpu variable
+ * offset.
+ */
+#define per_cpu(var, cpu) \
+       (*SHIFT_PERCPU_PTR(var, per_cpu_offset(cpu)))
+#define __get_cpu_var(var) \
+       (*SHIFT_PERCPU_PTR(var, my_cpu_offset))
+#define __raw_get_cpu_var(var) \
+       (*SHIFT_PERCPU_PTR(var, __my_cpu_offset))
+
+#else /* ! SMP */
+
+#define per_cpu(var, cpu)              (*((void)(cpu), &per_cpu_var(var)))
+#define __get_cpu_var(var)             per_cpu_var(var)
+#define __raw_get_cpu_var(var)         per_cpu_var(var)
+
+#define PER_CPU_ATTRIBUTES
+
+#endif /* SMP */
+
+#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu_var(name)
+
+#endif /* __ALPHA_PERCPU_H */
diff --git a/arch/alpha/include/asm/pgalloc.h b/arch/alpha/include/asm/pgalloc.h
new file mode 100644 (file)
index 0000000..fd09015
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef _ALPHA_PGALLOC_H
+#define _ALPHA_PGALLOC_H
+
+#include <linux/mm.h>
+#include <linux/mmzone.h>
+
+/*      
+ * Allocate and free page tables. The xxx_kernel() versions are
+ * used to allocate a kernel page table - this turns on ASN bits
+ * if any.
+ */
+
+static inline void
+pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t pte)
+{
+       pmd_set(pmd, (pte_t *)(page_to_pa(pte) + PAGE_OFFSET));
+}
+#define pmd_pgtable(pmd) pmd_page(pmd)
+
+static inline void
+pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
+{
+       pmd_set(pmd, pte);
+}
+
+static inline void
+pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
+{
+       pgd_set(pgd, pmd);
+}
+
+extern pgd_t *pgd_alloc(struct mm_struct *mm);
+
+static inline void
+pgd_free(struct mm_struct *mm, pgd_t *pgd)
+{
+       free_page((unsigned long)pgd);
+}
+
+static inline pmd_t *
+pmd_alloc_one(struct mm_struct *mm, unsigned long address)
+{
+       pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
+       return ret;
+}
+
+static inline void
+pmd_free(struct mm_struct *mm, pmd_t *pmd)
+{
+       free_page((unsigned long)pmd);
+}
+
+extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr);
+
+static inline void
+pte_free_kernel(struct mm_struct *mm, pte_t *pte)
+{
+       free_page((unsigned long)pte);
+}
+
+static inline pgtable_t
+pte_alloc_one(struct mm_struct *mm, unsigned long address)
+{
+       pte_t *pte = pte_alloc_one_kernel(mm, address);
+       struct page *page;
+
+       if (!pte)
+               return NULL;
+       page = virt_to_page(pte);
+       pgtable_page_ctor(page);
+       return page;
+}
+
+static inline void
+pte_free(struct mm_struct *mm, pgtable_t page)
+{
+       pgtable_page_dtor(page);
+       __free_page(page);
+}
+
+#define check_pgt_cache()      do { } while (0)
+
+#endif /* _ALPHA_PGALLOC_H */
diff --git a/arch/alpha/include/asm/pgtable.h b/arch/alpha/include/asm/pgtable.h
new file mode 100644 (file)
index 0000000..3f0c59f
--- /dev/null
@@ -0,0 +1,380 @@
+#ifndef _ALPHA_PGTABLE_H
+#define _ALPHA_PGTABLE_H
+
+#include <asm-generic/4level-fixup.h>
+
+/*
+ * This file contains the functions and defines necessary to modify and use
+ * the Alpha page table tree.
+ *
+ * This hopefully works with any standard Alpha page-size, as defined
+ * in <asm/page.h> (currently 8192).
+ */
+#include <linux/mmzone.h>
+
+#include <asm/page.h>
+#include <asm/processor.h>     /* For TASK_SIZE */
+#include <asm/machvec.h>
+
+struct mm_struct;
+struct vm_area_struct;
+
+/* Certain architectures need to do special things when PTEs
+ * within a page table are directly modified.  Thus, the following
+ * hook is made available.
+ */
+#define set_pte(pteptr, pteval) ((*(pteptr)) = (pteval))
+#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
+
+/* PMD_SHIFT determines the size of the area a second-level page table can map */
+#define PMD_SHIFT      (PAGE_SHIFT + (PAGE_SHIFT-3))
+#define PMD_SIZE       (1UL << PMD_SHIFT)
+#define PMD_MASK       (~(PMD_SIZE-1))
+
+/* PGDIR_SHIFT determines what a third-level page table entry can map */
+#define PGDIR_SHIFT    (PAGE_SHIFT + 2*(PAGE_SHIFT-3))
+#define PGDIR_SIZE     (1UL << PGDIR_SHIFT)
+#define PGDIR_MASK     (~(PGDIR_SIZE-1))
+
+/*
+ * Entries per page directory level:  the Alpha is three-level, with
+ * all levels having a one-page page table.
+ */
+#define PTRS_PER_PTE   (1UL << (PAGE_SHIFT-3))
+#define PTRS_PER_PMD   (1UL << (PAGE_SHIFT-3))
+#define PTRS_PER_PGD   (1UL << (PAGE_SHIFT-3))
+#define USER_PTRS_PER_PGD      (TASK_SIZE / PGDIR_SIZE)
+#define FIRST_USER_ADDRESS     0
+
+/* Number of pointers that fit on a page:  this will go away. */
+#define PTRS_PER_PAGE  (1UL << (PAGE_SHIFT-3))
+
+#ifdef CONFIG_ALPHA_LARGE_VMALLOC
+#define VMALLOC_START          0xfffffe0000000000
+#else
+#define VMALLOC_START          (-2*PGDIR_SIZE)
+#endif
+#define VMALLOC_END            (-PGDIR_SIZE)
+
+/*
+ * OSF/1 PAL-code-imposed page table bits
+ */
+#define _PAGE_VALID    0x0001
+#define _PAGE_FOR      0x0002  /* used for page protection (fault on read) */
+#define _PAGE_FOW      0x0004  /* used for page protection (fault on write) */
+#define _PAGE_FOE      0x0008  /* used for page protection (fault on exec) */
+#define _PAGE_ASM      0x0010
+#define _PAGE_KRE      0x0100  /* xxx - see below on the "accessed" bit */
+#define _PAGE_URE      0x0200  /* xxx */
+#define _PAGE_KWE      0x1000  /* used to do the dirty bit in software */
+#define _PAGE_UWE      0x2000  /* used to do the dirty bit in software */
+
+/* .. and these are ours ... */
+#define _PAGE_DIRTY    0x20000
+#define _PAGE_ACCESSED 0x40000
+#define _PAGE_FILE     0x80000 /* set:pagecache, unset:swap */
+
+/*
+ * NOTE! The "accessed" bit isn't necessarily exact:  it can be kept exactly
+ * by software (use the KRE/URE/KWE/UWE bits appropriately), but I'll fake it.
+ * Under Linux/AXP, the "accessed" bit just means "read", and I'll just use
+ * the KRE/URE bits to watch for it. That way we don't need to overload the
+ * KWE/UWE bits with both handling dirty and accessed.
+ *
+ * Note that the kernel uses the accessed bit just to check whether to page
+ * out a page or not, so it doesn't have to be exact anyway.
+ */
+
+#define __DIRTY_BITS   (_PAGE_DIRTY | _PAGE_KWE | _PAGE_UWE)
+#define __ACCESS_BITS  (_PAGE_ACCESSED | _PAGE_KRE | _PAGE_URE)
+
+#define _PFN_MASK      0xFFFFFFFF00000000UL
+
+#define _PAGE_TABLE    (_PAGE_VALID | __DIRTY_BITS | __ACCESS_BITS)
+#define _PAGE_CHG_MASK (_PFN_MASK | __DIRTY_BITS | __ACCESS_BITS)
+
+/*
+ * All the normal masks have the "page accessed" bits on, as any time they are used,
+ * the page is accessed. They are cleared only by the page-out routines
+ */
+#define PAGE_NONE      __pgprot(_PAGE_VALID | __ACCESS_BITS | _PAGE_FOR | _PAGE_FOW | _PAGE_FOE)
+#define PAGE_SHARED    __pgprot(_PAGE_VALID | __ACCESS_BITS)
+#define PAGE_COPY      __pgprot(_PAGE_VALID | __ACCESS_BITS | _PAGE_FOW)
+#define PAGE_READONLY  __pgprot(_PAGE_VALID | __ACCESS_BITS | _PAGE_FOW)
+#define PAGE_KERNEL    __pgprot(_PAGE_VALID | _PAGE_ASM | _PAGE_KRE | _PAGE_KWE)
+
+#define _PAGE_NORMAL(x) __pgprot(_PAGE_VALID | __ACCESS_BITS | (x))
+
+#define _PAGE_P(x) _PAGE_NORMAL((x) | (((x) & _PAGE_FOW)?0:_PAGE_FOW))
+#define _PAGE_S(x) _PAGE_NORMAL(x)
+
+/*
+ * The hardware can handle write-only mappings, but as the Alpha
+ * architecture does byte-wide writes with a read-modify-write
+ * sequence, it's not practical to have write-without-read privs.
+ * Thus the "-w- -> rw-" and "-wx -> rwx" mapping here (and in
+ * arch/alpha/mm/fault.c)
+ */
+       /* xwr */
+#define __P000 _PAGE_P(_PAGE_FOE | _PAGE_FOW | _PAGE_FOR)
+#define __P001 _PAGE_P(_PAGE_FOE | _PAGE_FOW)
+#define __P010 _PAGE_P(_PAGE_FOE)
+#define __P011 _PAGE_P(_PAGE_FOE)
+#define __P100 _PAGE_P(_PAGE_FOW | _PAGE_FOR)
+#define __P101 _PAGE_P(_PAGE_FOW)
+#define __P110 _PAGE_P(0)
+#define __P111 _PAGE_P(0)
+
+#define __S000 _PAGE_S(_PAGE_FOE | _PAGE_FOW | _PAGE_FOR)
+#define __S001 _PAGE_S(_PAGE_FOE | _PAGE_FOW)
+#define __S010 _PAGE_S(_PAGE_FOE)
+#define __S011 _PAGE_S(_PAGE_FOE)
+#define __S100 _PAGE_S(_PAGE_FOW | _PAGE_FOR)
+#define __S101 _PAGE_S(_PAGE_FOW)
+#define __S110 _PAGE_S(0)
+#define __S111 _PAGE_S(0)
+
+/*
+ * pgprot_noncached() is only for infiniband pci support, and a real
+ * implementation for RAM would be more complicated.
+ */
+#define pgprot_noncached(prot) (prot)
+
+/*
+ * BAD_PAGETABLE is used when we need a bogus page-table, while
+ * BAD_PAGE is used for a bogus page.
+ *
+ * ZERO_PAGE is a global shared page that is always zero:  used
+ * for zero-mapped memory areas etc..
+ */
+extern pte_t __bad_page(void);
+extern pmd_t * __bad_pagetable(void);
+
+extern unsigned long __zero_page(void);
+
+#define BAD_PAGETABLE  __bad_pagetable()
+#define BAD_PAGE       __bad_page()
+#define ZERO_PAGE(vaddr)       (virt_to_page(ZERO_PGE))
+
+/* number of bits that fit into a memory pointer */
+#define BITS_PER_PTR                   (8*sizeof(unsigned long))
+
+/* to align the pointer to a pointer address */
+#define PTR_MASK                       (~(sizeof(void*)-1))
+
+/* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */
+#define SIZEOF_PTR_LOG2                        3
+
+/* to find an entry in a page-table */
+#define PAGE_PTR(address)              \
+  ((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
+
+/*
+ * On certain platforms whose physical address space can overlap KSEG,
+ * namely EV6 and above, we must re-twiddle the physaddr to restore the
+ * correct high-order bits.
+ *
+ * This is extremely confusing until you realize that this is actually
+ * just working around a userspace bug.  The X server was intending to
+ * provide the physical address but instead provided the KSEG address.
+ * Or tried to, except it's not representable.
+ * 
+ * On Tsunami there's nothing meaningful at 0x40000000000, so this is
+ * a safe thing to do.  Come the first core logic that does put something
+ * in this area -- memory or whathaveyou -- then this hack will have
+ * to go away.  So be prepared!
+ */
+
+#if defined(CONFIG_ALPHA_GENERIC) && defined(USE_48_BIT_KSEG)
+#error "EV6-only feature in a generic kernel"
+#endif
+#if defined(CONFIG_ALPHA_GENERIC) || \
+    (defined(CONFIG_ALPHA_EV6) && !defined(USE_48_BIT_KSEG))
+#define KSEG_PFN       (0xc0000000000UL >> PAGE_SHIFT)
+#define PHYS_TWIDDLE(pfn) \
+  ((((pfn) & KSEG_PFN) == (0x40000000000UL >> PAGE_SHIFT)) \
+  ? ((pfn) ^= KSEG_PFN) : (pfn))
+#else
+#define PHYS_TWIDDLE(pfn) (pfn)
+#endif
+
+/*
+ * Conversion functions:  convert a page and protection to a page entry,
+ * and a page entry and page directory to the page they refer to.
+ */
+#ifndef CONFIG_DISCONTIGMEM
+#define page_to_pa(page)       (((page) - mem_map) << PAGE_SHIFT)
+
+#define pte_pfn(pte)   (pte_val(pte) >> 32)
+#define pte_page(pte)  pfn_to_page(pte_pfn(pte))
+#define mk_pte(page, pgprot)                                           \
+({                                                                     \
+       pte_t pte;                                                      \
+                                                                       \
+       pte_val(pte) = (page_to_pfn(page) << 32) | pgprot_val(pgprot);  \
+       pte;                                                            \
+})
+#endif
+
+extern inline pte_t pfn_pte(unsigned long physpfn, pgprot_t pgprot)
+{ pte_t pte; pte_val(pte) = (PHYS_TWIDDLE(physpfn) << 32) | pgprot_val(pgprot); return pte; }
+
+extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
+{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; }
+
+extern inline void pmd_set(pmd_t * pmdp, pte_t * ptep)
+{ pmd_val(*pmdp) = _PAGE_TABLE | ((((unsigned long) ptep) - PAGE_OFFSET) << (32-PAGE_SHIFT)); }
+
+extern inline void pgd_set(pgd_t * pgdp, pmd_t * pmdp)
+{ pgd_val(*pgdp) = _PAGE_TABLE | ((((unsigned long) pmdp) - PAGE_OFFSET) << (32-PAGE_SHIFT)); }
+
+
+extern inline unsigned long
+pmd_page_vaddr(pmd_t pmd)
+{
+       return ((pmd_val(pmd) & _PFN_MASK) >> (32-PAGE_SHIFT)) + PAGE_OFFSET;
+}
+
+#ifndef CONFIG_DISCONTIGMEM
+#define pmd_page(pmd)  (mem_map + ((pmd_val(pmd) & _PFN_MASK) >> 32))
+#define pgd_page(pgd)  (mem_map + ((pgd_val(pgd) & _PFN_MASK) >> 32))
+#endif
+
+extern inline unsigned long pgd_page_vaddr(pgd_t pgd)
+{ return PAGE_OFFSET + ((pgd_val(pgd) & _PFN_MASK) >> (32-PAGE_SHIFT)); }
+
+extern inline int pte_none(pte_t pte)          { return !pte_val(pte); }
+extern inline int pte_present(pte_t pte)       { return pte_val(pte) & _PAGE_VALID; }
+extern inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
+{
+       pte_val(*ptep) = 0;
+}
+
+extern inline int pmd_none(pmd_t pmd)          { return !pmd_val(pmd); }
+extern inline int pmd_bad(pmd_t pmd)           { return (pmd_val(pmd) & ~_PFN_MASK) != _PAGE_TABLE; }
+extern inline int pmd_present(pmd_t pmd)       { return pmd_val(pmd) & _PAGE_VALID; }
+extern inline void pmd_clear(pmd_t * pmdp)     { pmd_val(*pmdp) = 0; }
+
+extern inline int pgd_none(pgd_t pgd)          { return !pgd_val(pgd); }
+extern inline int pgd_bad(pgd_t pgd)           { return (pgd_val(pgd) & ~_PFN_MASK) != _PAGE_TABLE; }
+extern inline int pgd_present(pgd_t pgd)       { return pgd_val(pgd) & _PAGE_VALID; }
+extern inline void pgd_clear(pgd_t * pgdp)     { pgd_val(*pgdp) = 0; }
+
+/*
+ * The following only work if pte_present() is true.
+ * Undefined behaviour if not..
+ */
+extern inline int pte_write(pte_t pte)         { return !(pte_val(pte) & _PAGE_FOW); }
+extern inline int pte_dirty(pte_t pte)         { return pte_val(pte) & _PAGE_DIRTY; }
+extern inline int pte_young(pte_t pte)         { return pte_val(pte) & _PAGE_ACCESSED; }
+extern inline int pte_file(pte_t pte)          { return pte_val(pte) & _PAGE_FILE; }
+extern inline int pte_special(pte_t pte)       { return 0; }
+
+extern inline pte_t pte_wrprotect(pte_t pte)   { pte_val(pte) |= _PAGE_FOW; return pte; }
+extern inline pte_t pte_mkclean(pte_t pte)     { pte_val(pte) &= ~(__DIRTY_BITS); return pte; }
+extern inline pte_t pte_mkold(pte_t pte)       { pte_val(pte) &= ~(__ACCESS_BITS); return pte; }
+extern inline pte_t pte_mkwrite(pte_t pte)     { pte_val(pte) &= ~_PAGE_FOW; return pte; }
+extern inline pte_t pte_mkdirty(pte_t pte)     { pte_val(pte) |= __DIRTY_BITS; return pte; }
+extern inline pte_t pte_mkyoung(pte_t pte)     { pte_val(pte) |= __ACCESS_BITS; return pte; }
+extern inline pte_t pte_mkspecial(pte_t pte)   { return pte; }
+
+#define PAGE_DIR_OFFSET(tsk,address) pgd_offset((tsk),(address))
+
+/* to find an entry in a kernel page-table-directory */
+#define pgd_offset_k(address) pgd_offset(&init_mm, (address))
+
+/* to find an entry in a page-table-directory. */
+#define pgd_index(address)     (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
+#define pgd_offset(mm, address)        ((mm)->pgd+pgd_index(address))
+
+/*
+ * The smp_read_barrier_depends() in the following functions are required to
+ * order the load of *dir (the pointer in the top level page table) with any
+ * subsequent load of the returned pmd_t *ret (ret is data dependent on *dir).
+ *
+ * If this ordering is not enforced, the CPU might load an older value of
+ * *ret, which may be uninitialized data. See mm/memory.c:__pte_alloc for
+ * more details.
+ *
+ * Note that we never change the mm->pgd pointer after the task is running, so
+ * pgd_offset does not require such a barrier.
+ */
+
+/* Find an entry in the second-level page table.. */
+extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
+{
+       pmd_t *ret = (pmd_t *) pgd_page_vaddr(*dir) + ((address >> PMD_SHIFT) & (PTRS_PER_PAGE - 1));
+       smp_read_barrier_depends(); /* see above */
+       return ret;
+}
+
+/* Find an entry in the third-level page table.. */
+extern inline pte_t * pte_offset_kernel(pmd_t * dir, unsigned long address)
+{
+       pte_t *ret = (pte_t *) pmd_page_vaddr(*dir)
+               + ((address >> PAGE_SHIFT) & (PTRS_PER_PAGE - 1));
+       smp_read_barrier_depends(); /* see above */
+       return ret;
+}
+
+#define pte_offset_map(dir,addr)       pte_offset_kernel((dir),(addr))
+#define pte_offset_map_nested(dir,addr)        pte_offset_kernel((dir),(addr))
+#define pte_unmap(pte)                 do { } while (0)
+#define pte_unmap_nested(pte)          do { } while (0)
+
+extern pgd_t swapper_pg_dir[1024];
+
+/*
+ * The Alpha doesn't have any external MMU info:  the kernel page
+ * tables contain all the necessary information.
+ */
+extern inline void update_mmu_cache(struct vm_area_struct * vma,
+       unsigned long address, pte_t pte)
+{
+}
+
+/*
+ * Non-present pages:  high 24 bits are offset, next 8 bits type,
+ * low 32 bits zero.
+ */
+extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
+{ pte_t pte; pte_val(pte) = (type << 32) | (offset << 40); return pte; }
+
+#define __swp_type(x)          (((x).val >> 32) & 0xff)
+#define __swp_offset(x)                ((x).val >> 40)
+#define __swp_entry(type, off) ((swp_entry_t) { pte_val(mk_swap_pte((type), (off))) })
+#define __pte_to_swp_entry(pte)        ((swp_entry_t) { pte_val(pte) })
+#define __swp_entry_to_pte(x)  ((pte_t) { (x).val })
+
+#define pte_to_pgoff(pte)      (pte_val(pte) >> 32)
+#define pgoff_to_pte(off)      ((pte_t) { ((off) << 32) | _PAGE_FILE })
+
+#define PTE_FILE_MAX_BITS      32
+
+#ifndef CONFIG_DISCONTIGMEM
+#define kern_addr_valid(addr)  (1)
+#endif
+
+#define io_remap_pfn_range(vma, start, pfn, size, prot)        \
+               remap_pfn_range(vma, start, pfn, size, prot)
+
+#define pte_ERROR(e) \
+       printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
+#define pmd_ERROR(e) \
+       printk("%s:%d: bad pmd %016lx.\n", __FILE__, __LINE__, pmd_val(e))
+#define pgd_ERROR(e) \
+       printk("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e))
+
+extern void paging_init(void);
+
+#include <asm-generic/pgtable.h>
+
+/*
+ * No page table caches to initialise
+ */
+#define pgtable_cache_init()   do { } while (0)
+
+/* We have our own get_unmapped_area to cope with ADDR_LIMIT_32BIT.  */
+#define HAVE_ARCH_UNMAPPED_AREA
+
+#endif /* _ALPHA_PGTABLE_H */
diff --git a/arch/alpha/include/asm/poll.h b/arch/alpha/include/asm/poll.h
new file mode 100644 (file)
index 0000000..c98509d
--- /dev/null
@@ -0,0 +1 @@
+#include <asm-generic/poll.h>
diff --git a/arch/alpha/include/asm/posix_types.h b/arch/alpha/include/asm/posix_types.h
new file mode 100644 (file)
index 0000000..db16741
--- /dev/null
@@ -0,0 +1,123 @@
+#ifndef _ALPHA_POSIX_TYPES_H
+#define _ALPHA_POSIX_TYPES_H
+
+/*
+ * This file is generally used by user-level software, so you need to
+ * be a little careful about namespace pollution etc.  Also, we cannot
+ * assume GCC is being used.
+ */
+
+typedef unsigned int   __kernel_ino_t;
+typedef unsigned int   __kernel_mode_t;
+typedef unsigned int   __kernel_nlink_t;
+typedef long           __kernel_off_t;
+typedef long long      __kernel_loff_t;
+typedef int            __kernel_pid_t;
+typedef int            __kernel_ipc_pid_t;
+typedef unsigned int   __kernel_uid_t;
+typedef unsigned int   __kernel_gid_t;
+typedef unsigned long  __kernel_size_t;
+typedef long           __kernel_ssize_t;
+typedef long           __kernel_ptrdiff_t;
+typedef long           __kernel_time_t;
+typedef long           __kernel_suseconds_t;
+typedef long           __kernel_clock_t;
+typedef int            __kernel_daddr_t;
+typedef char *         __kernel_caddr_t;
+typedef unsigned long  __kernel_sigset_t;      /* at least 32 bits */
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef int            __kernel_clockid_t;
+typedef int            __kernel_timer_t;
+
+typedef struct {
+       int     val[2];
+} __kernel_fsid_t;
+
+typedef __kernel_uid_t __kernel_old_uid_t;
+typedef __kernel_gid_t __kernel_old_gid_t;
+typedef __kernel_uid_t __kernel_uid32_t;
+typedef __kernel_gid_t __kernel_gid32_t;
+
+typedef unsigned int   __kernel_old_dev_t;
+
+#ifdef __KERNEL__
+
+#ifndef __GNUC__
+
+#define        __FD_SET(d, set)        ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
+#define        __FD_CLR(d, set)        ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
+#define        __FD_ISSET(d, set)      (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0)
+#define        __FD_ZERO(set)  \
+  ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set)))
+
+#else /* __GNUC__ */
+
+/* With GNU C, use inline functions instead so args are evaluated only once: */
+
+#undef __FD_SET
+static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
+{
+       unsigned long _tmp = fd / __NFDBITS;
+       unsigned long _rem = fd % __NFDBITS;
+       fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
+}
+
+#undef __FD_CLR
+static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
+{
+       unsigned long _tmp = fd / __NFDBITS;
+       unsigned long _rem = fd % __NFDBITS;
+       fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
+}
+
+#undef __FD_ISSET
+static __inline__ int __FD_ISSET(unsigned long fd, const __kernel_fd_set *p)
+{ 
+       unsigned long _tmp = fd / __NFDBITS;
+       unsigned long _rem = fd % __NFDBITS;
+       return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0;
+}
+
+/*
+ * This will unroll the loop for the normal constant case (8 ints,
+ * for a 256-bit fd_set)
+ */
+#undef __FD_ZERO
+static __inline__ void __FD_ZERO(__kernel_fd_set *p)
+{
+       unsigned long *tmp = p->fds_bits;
+       int i;
+
+       if (__builtin_constant_p(__FDSET_LONGS)) {
+               switch (__FDSET_LONGS) {
+                     case 16:
+                       tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
+                       tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
+                       tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;
+                       tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
+                       return;
+
+                     case 8:
+                       tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
+                       tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
+                       return;
+
+                     case 4:
+                       tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
+                       return;
+               }
+       }
+       i = __FDSET_LONGS;
+       while (i) {
+               i--;
+               *tmp = 0;
+               tmp++;
+       }
+}
+
+#endif /* __GNUC__ */
+
+#endif /* __KERNEL__ */
+
+#endif /* _ALPHA_POSIX_TYPES_H */
diff --git a/arch/alpha/include/asm/processor.h b/arch/alpha/include/asm/processor.h
new file mode 100644 (file)
index 0000000..94afe58
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * include/asm-alpha/processor.h
+ *
+ * Copyright (C) 1994 Linus Torvalds
+ */
+
+#ifndef __ASM_ALPHA_PROCESSOR_H
+#define __ASM_ALPHA_PROCESSOR_H
+
+#include <linux/personality.h> /* for ADDR_LIMIT_32BIT */
+
+/*
+ * Returns current instruction pointer ("program counter").
+ */
+#define current_text_addr() \
+  ({ void *__pc; __asm__ ("br %0,.+4" : "=r"(__pc)); __pc; })
+
+/*
+ * We have a 42-bit user address space: 4TB user VM...
+ */
+#define TASK_SIZE (0x40000000000UL)
+
+#define STACK_TOP \
+  (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL)
+
+#define STACK_TOP_MAX  0x00120000000UL
+
+/* This decides where the kernel will search for a free chunk of vm
+ * space during mmap's.
+ */
+#define TASK_UNMAPPED_BASE \
+  ((current->personality & ADDR_LIMIT_32BIT) ? 0x40000000 : TASK_SIZE / 2)
+
+typedef struct {
+       unsigned long seg;
+} mm_segment_t;
+
+/* This is dead.  Everything has been moved to thread_info.  */
+struct thread_struct { };
+#define INIT_THREAD  { }
+
+/* Return saved PC of a blocked thread.  */
+struct task_struct;
+extern unsigned long thread_saved_pc(struct task_struct *);
+
+/* Do necessary setup to start up a newly executed thread.  */
+extern void start_thread(struct pt_regs *, unsigned long, unsigned long);
+
+/* Free all resources held by a thread. */
+extern void release_thread(struct task_struct *);
+
+/* Prepare to copy thread state - unlazy all lazy status */
+#define prepare_to_copy(tsk)   do { } while (0)
+
+/* Create a kernel thread without removing it from tasklists.  */
+extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
+
+unsigned long get_wchan(struct task_struct *p);
+
+#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
+
+#define KSTK_ESP(tsk) \
+  ((tsk) == current ? rdusp() : task_thread_info(tsk)->pcb.usp)
+
+#define cpu_relax()    barrier()
+
+#define ARCH_HAS_PREFETCH
+#define ARCH_HAS_PREFETCHW
+#define ARCH_HAS_SPINLOCK_PREFETCH
+
+#ifndef CONFIG_SMP
+/* Nothing to prefetch. */
+#define spin_lock_prefetch(lock)       do { } while (0)
+#endif
+
+extern inline void prefetch(const void *ptr)  
+{ 
+       __builtin_prefetch(ptr, 0, 3);
+}
+
+extern inline void prefetchw(const void *ptr)  
+{
+       __builtin_prefetch(ptr, 1, 3);
+}
+
+#ifdef CONFIG_SMP
+extern inline void spin_lock_prefetch(const void *ptr)  
+{
+       __builtin_prefetch(ptr, 1, 3);
+}
+#endif
+
+#endif /* __ASM_ALPHA_PROCESSOR_H */
diff --git a/arch/alpha/include/asm/ptrace.h b/arch/alpha/include/asm/ptrace.h
new file mode 100644 (file)
index 0000000..32c7a5c
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef _ASMAXP_PTRACE_H
+#define _ASMAXP_PTRACE_H
+
+
+/*
+ * This struct defines the way the registers are stored on the
+ * kernel stack during a system call or other kernel entry
+ *
+ * NOTE! I want to minimize the overhead of system calls, so this
+ * struct has as little information as possible.  I does not have
+ *
+ *  - floating point regs: the kernel doesn't change those
+ *  - r9-15: saved by the C compiler
+ *
+ * This makes "fork()" and "exec()" a bit more complex, but should
+ * give us low system call latency.
+ */
+
+struct pt_regs {
+       unsigned long r0;
+       unsigned long r1;
+       unsigned long r2;
+       unsigned long r3;
+       unsigned long r4;
+       unsigned long r5;
+       unsigned long r6;
+       unsigned long r7;
+       unsigned long r8;
+       unsigned long r19;
+       unsigned long r20;
+       unsigned long r21;
+       unsigned long r22;
+       unsigned long r23;
+       unsigned long r24;
+       unsigned long r25;
+       unsigned long r26;
+       unsigned long r27;
+       unsigned long r28;
+       unsigned long hae;
+/* JRP - These are the values provided to a0-a2 by PALcode */
+       unsigned long trap_a0;
+       unsigned long trap_a1;
+       unsigned long trap_a2;
+/* These are saved by PAL-code: */
+       unsigned long ps;
+       unsigned long pc;
+       unsigned long gp;
+       unsigned long r16;
+       unsigned long r17;
+       unsigned long r18;
+};
+
+/*
+ * This is the extended stack used by signal handlers and the context
+ * switcher: it's pushed after the normal "struct pt_regs".
+ */
+struct switch_stack {
+       unsigned long r9;
+       unsigned long r10;
+       unsigned long r11;
+       unsigned long r12;
+       unsigned long r13;
+       unsigned long r14;
+       unsigned long r15;
+       unsigned long r26;
+       unsigned long fp[32];   /* fp[31] is fpcr */
+};
+
+#ifdef __KERNEL__
+
+#define user_mode(regs) (((regs)->ps & 8) != 0)
+#define instruction_pointer(regs) ((regs)->pc)
+#define profile_pc(regs) instruction_pointer(regs)
+extern void show_regs(struct pt_regs *);
+
+#define task_pt_regs(task) \
+  ((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1)
+
+#define force_successful_syscall_return() (task_pt_regs(current)->r0 = 0)
+
+#endif
+
+#endif
diff --git a/arch/alpha/include/asm/reg.h b/arch/alpha/include/asm/reg.h
new file mode 100644 (file)
index 0000000..86ff916
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef __reg_h__
+#define __reg_h__
+
+/*
+ * Exception frame offsets.
+ */
+#define EF_V0          0
+#define EF_T0          1
+#define EF_T1          2
+#define EF_T2          3
+#define EF_T3          4
+#define EF_T4          5
+#define EF_T5          6
+#define EF_T6          7
+#define EF_T7          8
+#define EF_S0          9
+#define EF_S1          10
+#define EF_S2          11
+#define EF_S3          12
+#define EF_S4          13
+#define EF_S5          14
+#define EF_S6          15
+#define EF_A3          16
+#define EF_A4          17
+#define EF_A5          18
+#define EF_T8          19
+#define EF_T9          20
+#define EF_T10         21
+#define EF_T11         22
+#define EF_RA          23
+#define EF_T12         24
+#define EF_AT          25
+#define EF_SP          26
+#define EF_PS          27
+#define EF_PC          28
+#define EF_GP          29
+#define EF_A0          30
+#define EF_A1          31
+#define EF_A2          32
+
+#define EF_SIZE                (33*8)
+#define HWEF_SIZE      (6*8)           /* size of PAL frame (PS-A2) */
+
+#define EF_SSIZE       (EF_SIZE - HWEF_SIZE)
+
+/*
+ * Map register number into core file offset.
+ */
+#define CORE_REG(reg, ubase) \
+       (((unsigned long *)((unsigned long)(ubase)))[reg])
+
+#endif /* __reg_h__ */
diff --git a/arch/alpha/include/asm/regdef.h b/arch/alpha/include/asm/regdef.h
new file mode 100644 (file)
index 0000000..142df9c
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef __alpha_regdef_h__
+#define __alpha_regdef_h__
+
+#define v0     $0      /* function return value */
+
+#define t0     $1      /* temporary registers (caller-saved) */
+#define t1     $2
+#define t2     $3
+#define t3     $4
+#define t4     $5
+#define t5     $6
+#define t6     $7
+#define t7     $8
+
+#define        s0      $9      /* saved-registers (callee-saved registers) */
+#define        s1      $10
+#define        s2      $11
+#define        s3      $12
+#define        s4      $13
+#define        s5      $14
+#define        s6      $15
+#define        fp      s6      /* frame-pointer (s6 in frame-less procedures) */
+
+#define a0     $16     /* argument registers (caller-saved) */
+#define a1     $17
+#define a2     $18
+#define a3     $19
+#define a4     $20
+#define a5     $21
+
+#define t8     $22     /* more temps (caller-saved) */
+#define t9     $23
+#define t10    $24
+#define t11    $25
+#define ra     $26     /* return address register */
+#define t12    $27
+
+#define pv     t12     /* procedure-variable register */
+#define AT     $at     /* assembler temporary */
+#define gp     $29     /* global pointer */
+#define sp     $30     /* stack pointer */
+#define zero   $31     /* reads as zero, writes are noops */
+
+#endif /* __alpha_regdef_h__ */
diff --git a/arch/alpha/include/asm/resource.h b/arch/alpha/include/asm/resource.h
new file mode 100644 (file)
index 0000000..c10874f
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef _ALPHA_RESOURCE_H
+#define _ALPHA_RESOURCE_H
+
+/*
+ * Alpha/Linux-specific ordering of these four resource limit IDs,
+ * the rest comes from the generic header:
+ */
+#define RLIMIT_NOFILE          6       /* max number of open files */
+#define RLIMIT_AS              7       /* address space limit */
+#define RLIMIT_NPROC           8       /* max number of processes */
+#define RLIMIT_MEMLOCK         9       /* max locked-in-memory address space */
+
+/*
+ * SuS says limits have to be unsigned.  Fine, it's unsigned, but
+ * we retain the old value for compatibility, especially with DU. 
+ * When you run into the 2^63 barrier, you call me.
+ */
+#define RLIM_INFINITY          0x7ffffffffffffffful
+
+#include <asm-generic/resource.h>
+
+#endif /* _ALPHA_RESOURCE_H */
diff --git a/arch/alpha/include/asm/rtc.h b/arch/alpha/include/asm/rtc.h
new file mode 100644 (file)
index 0000000..4e854b1
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef _ALPHA_RTC_H
+#define _ALPHA_RTC_H
+
+/*
+ * Alpha uses the default access methods for the RTC.
+ */
+
+#include <asm-generic/rtc.h>
+
+#endif
diff --git a/arch/alpha/include/asm/rwsem.h b/arch/alpha/include/asm/rwsem.h
new file mode 100644 (file)
index 0000000..1570c0b
--- /dev/null
@@ -0,0 +1,259 @@
+#ifndef _ALPHA_RWSEM_H
+#define _ALPHA_RWSEM_H
+
+/*
+ * Written by Ivan Kokshaysky <ink@jurassic.park.msu.ru>, 2001.
+ * Based on asm-alpha/semaphore.h and asm-i386/rwsem.h
+ */
+
+#ifndef _LINUX_RWSEM_H
+#error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead"
+#endif
+
+#ifdef __KERNEL__
+
+#include <linux/compiler.h>
+#include <linux/list.h>
+#include <linux/spinlock.h>
+
+struct rwsem_waiter;
+
+extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem);
+extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem);
+extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *);
+extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
+
+/*
+ * the semaphore definition
+ */
+struct rw_semaphore {
+       long                    count;
+#define RWSEM_UNLOCKED_VALUE           0x0000000000000000L
+#define RWSEM_ACTIVE_BIAS              0x0000000000000001L
+#define RWSEM_ACTIVE_MASK              0x00000000ffffffffL
+#define RWSEM_WAITING_BIAS             (-0x0000000100000000L)
+#define RWSEM_ACTIVE_READ_BIAS         RWSEM_ACTIVE_BIAS
+#define RWSEM_ACTIVE_WRITE_BIAS                (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
+       spinlock_t              wait_lock;
+       struct list_head        wait_list;
+};
+
+#define __RWSEM_INITIALIZER(name) \
+       { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
+       LIST_HEAD_INIT((name).wait_list) }
+
+#define DECLARE_RWSEM(name) \
+       struct rw_semaphore name = __RWSEM_INITIALIZER(name)
+
+static inline void init_rwsem(struct rw_semaphore *sem)
+{
+       sem->count = RWSEM_UNLOCKED_VALUE;
+       spin_lock_init(&sem->wait_lock);
+       INIT_LIST_HEAD(&sem->wait_list);
+}
+
+static inline void __down_read(struct rw_semaphore *sem)
+{
+       long oldcount;
+#ifndef        CONFIG_SMP
+       oldcount = sem->count;
+       sem->count += RWSEM_ACTIVE_READ_BIAS;
+#else
+       long temp;
+       __asm__ __volatile__(
+       "1:     ldq_l   %0,%1\n"
+       "       addq    %0,%3,%2\n"
+       "       stq_c   %2,%1\n"
+       "       beq     %2,2f\n"
+       "       mb\n"
+       ".subsection 2\n"
+       "2:     br      1b\n"
+       ".previous"
+       :"=&r" (oldcount), "=m" (sem->count), "=&r" (temp)
+       :"Ir" (RWSEM_ACTIVE_READ_BIAS), "m" (sem->count) : "memory");
+#endif
+       if (unlikely(oldcount < 0))
+               rwsem_down_read_failed(sem);
+}
+
+/*
+ * trylock for reading -- returns 1 if successful, 0 if contention
+ */
+static inline int __down_read_trylock(struct rw_semaphore *sem)
+{
+       long old, new, res;
+
+       res = sem->count;
+       do {
+               new = res + RWSEM_ACTIVE_READ_BIAS;
+               if (new <= 0)
+                       break;
+               old = res;
+               res = cmpxchg(&sem->count, old, new);
+       } while (res != old);
+       return res >= 0 ? 1 : 0;
+}
+
+static inline void __down_write(struct rw_semaphore *sem)
+{
+       long oldcount;
+#ifndef        CONFIG_SMP
+       oldcount = sem->count;
+       sem->count += RWSEM_ACTIVE_WRITE_BIAS;
+#else
+       long temp;
+       __asm__ __volatile__(
+       "1:     ldq_l   %0,%1\n"
+       "       addq    %0,%3,%2\n"
+       "       stq_c   %2,%1\n"
+       "       beq     %2,2f\n"
+       "       mb\n"
+       ".subsection 2\n"
+       "2:     br      1b\n"
+       ".previous"
+       :"=&r" (oldcount), "=m" (sem->count), "=&r" (temp)
+       :"Ir" (RWSEM_ACTIVE_WRITE_BIAS), "m" (sem->count) : "memory");
+#endif
+       if (unlikely(oldcount))
+               rwsem_down_write_failed(sem);
+}
+
+/*
+ * trylock for writing -- returns 1 if successful, 0 if contention
+ */
+static inline int __down_write_trylock(struct rw_semaphore *sem)
+{
+       long ret = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE,
+                          RWSEM_ACTIVE_WRITE_BIAS);
+       if (ret == RWSEM_UNLOCKED_VALUE)
+               return 1;
+       return 0;
+}
+
+static inline void __up_read(struct rw_semaphore *sem)
+{
+       long oldcount;
+#ifndef        CONFIG_SMP
+       oldcount = sem->count;
+       sem->count -= RWSEM_ACTIVE_READ_BIAS;
+#else
+       long temp;
+       __asm__ __volatile__(
+       "       mb\n"
+       "1:     ldq_l   %0,%1\n"
+       "       subq    %0,%3,%2\n"
+       "       stq_c   %2,%1\n"
+       "       beq     %2,2f\n"
+       ".subsection 2\n"
+       "2:     br      1b\n"
+       ".previous"
+       :"=&r" (oldcount), "=m" (sem->count), "=&r" (temp)
+       :"Ir" (RWSEM_ACTIVE_READ_BIAS), "m" (sem->count) : "memory");
+#endif
+       if (unlikely(oldcount < 0))
+               if ((int)oldcount - RWSEM_ACTIVE_READ_BIAS == 0)
+                       rwsem_wake(sem);
+}
+
+static inline void __up_write(struct rw_semaphore *sem)
+{
+       long count;
+#ifndef        CONFIG_SMP
+       sem->count -= RWSEM_ACTIVE_WRITE_BIAS;
+       count = sem->count;
+#else
+       long temp;
+       __asm__ __volatile__(
+       "       mb\n"
+       "1:     ldq_l   %0,%1\n"
+       "       subq    %0,%3,%2\n"
+       "       stq_c   %2,%1\n"
+       "       beq     %2,2f\n"
+       "       subq    %0,%3,%0\n"
+       ".subsection 2\n"
+       "2:     br      1b\n"
+       ".previous"
+       :"=&r" (count), "=m" (sem->count), "=&r" (temp)
+       :"Ir" (RWSEM_ACTIVE_WRITE_BIAS), "m" (sem->count) : "memory");
+#endif
+       if (unlikely(count))
+               if ((int)count == 0)
+                       rwsem_wake(sem);
+}
+
+/*
+ * downgrade write lock to read lock
+ */
+static inline void __downgrade_write(struct rw_semaphore *sem)
+{
+       long oldcount;
+#ifndef        CONFIG_SMP
+       oldcount = sem->count;
+       sem->count -= RWSEM_WAITING_BIAS;
+#else
+       long temp;
+       __asm__ __volatile__(
+       "1:     ldq_l   %0,%1\n"
+       "       addq    %0,%3,%2\n"
+       "       stq_c   %2,%1\n"
+       "       beq     %2,2f\n"
+       "       mb\n"
+       ".subsection 2\n"
+       "2:     br      1b\n"
+       ".previous"
+       :"=&r" (oldcount), "=m" (sem->count), "=&r" (temp)
+       :"Ir" (-RWSEM_WAITING_BIAS), "m" (sem->count) : "memory");
+#endif
+       if (unlikely(oldcount < 0))
+               rwsem_downgrade_wake(sem);
+}
+
+static inline void rwsem_atomic_add(long val, struct rw_semaphore *sem)
+{
+#ifndef        CONFIG_SMP
+       sem->count += val;
+#else
+       long temp;
+       __asm__ __volatile__(
+       "1:     ldq_l   %0,%1\n"
+       "       addq    %0,%2,%0\n"
+       "       stq_c   %0,%1\n"
+       "       beq     %0,2f\n"
+       ".subsection 2\n"
+       "2:     br      1b\n"
+       ".previous"
+       :"=&r" (temp), "=m" (sem->count)
+       :"Ir" (val), "m" (sem->count));
+#endif
+}
+
+static inline long rwsem_atomic_update(long val, struct rw_semaphore *sem)
+{
+#ifndef        CONFIG_SMP
+       sem->count += val;
+       return sem->count;
+#else
+       long ret, temp;
+       __asm__ __volatile__(
+       "1:     ldq_l   %0,%1\n"
+       "       addq    %0,%3,%2\n"
+       "       addq    %0,%3,%0\n"
+       "       stq_c   %2,%1\n"
+       "       beq     %2,2f\n"
+       ".subsection 2\n"
+       "2:     br      1b\n"
+       ".previous"
+       :"=&r" (ret), "=m" (sem->count), "=&r" (temp)
+       :"Ir" (val), "m" (sem->count));
+
+       return ret;
+#endif
+}
+
+static inline int rwsem_is_locked(struct rw_semaphore *sem)
+{
+       return (sem->count != 0);
+}
+
+#endif /* __KERNEL__ */
+#endif /* _ALPHA_RWSEM_H */
diff --git a/arch/alpha/include/asm/scatterlist.h b/arch/alpha/include/asm/scatterlist.h
new file mode 100644 (file)
index 0000000..440747c
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef _ALPHA_SCATTERLIST_H
+#define _ALPHA_SCATTERLIST_H
+
+#include <asm/page.h>
+#include <asm/types.h>
+  
+struct scatterlist {
+#ifdef CONFIG_DEBUG_SG
+       unsigned long sg_magic;
+#endif
+       unsigned long page_link;
+       unsigned int offset;
+
+       unsigned int length;
+
+       dma_addr_t dma_address;
+       __u32 dma_length;
+};
+
+#define sg_dma_address(sg)     ((sg)->dma_address)
+#define sg_dma_len(sg)         ((sg)->dma_length)
+
+#define ISA_DMA_THRESHOLD (~0UL)
+
+#endif /* !(_ALPHA_SCATTERLIST_H) */
diff --git a/arch/alpha/include/asm/sections.h b/arch/alpha/include/asm/sections.h
new file mode 100644 (file)
index 0000000..43b40ed
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef _ALPHA_SECTIONS_H
+#define _ALPHA_SECTIONS_H
+
+/* nothing to see, move along */
+#include <asm-generic/sections.h>
+
+#endif
diff --git a/arch/alpha/include/asm/segment.h b/arch/alpha/include/asm/segment.h
new file mode 100644 (file)
index 0000000..0453d97
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ALPHA_SEGMENT_H
+#define __ALPHA_SEGMENT_H
+
+/* Only here because we have some old header files that expect it.. */
+
+#endif
diff --git a/arch/alpha/include/asm/sembuf.h b/arch/alpha/include/asm/sembuf.h
new file mode 100644 (file)
index 0000000..7b38b15
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef _ALPHA_SEMBUF_H
+#define _ALPHA_SEMBUF_H
+
+/* 
+ * The semid64_ds structure for alpha architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 2 miscellaneous 64-bit values
+ */
+
+struct semid64_ds {
+       struct ipc64_perm sem_perm;             /* permissions .. see ipc.h */
+       __kernel_time_t sem_otime;              /* last semop time */
+       __kernel_time_t sem_ctime;              /* last change time */
+       unsigned long   sem_nsems;              /* no. of semaphores in array */
+       unsigned long   __unused1;
+       unsigned long   __unused2;
+};
+
+#endif /* _ALPHA_SEMBUF_H */
diff --git a/arch/alpha/include/asm/serial.h b/arch/alpha/include/asm/serial.h
new file mode 100644 (file)
index 0000000..9d263e8
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * include/asm-alpha/serial.h
+ */
+
+
+/*
+ * This assumes you have a 1.8432 MHz clock for your UART.
+ *
+ * It'd be nice if someone built a serial card with a 24.576 MHz
+ * clock, since the 16550A is capable of handling a top speed of 1.5
+ * megabits/second; but this requires the faster clock.
+ */
+#define BASE_BAUD ( 1843200 / 16 )
+
+/* Standard COM flags (except for COM4, because of the 8514 problem) */
+#ifdef CONFIG_SERIAL_DETECT_IRQ
+#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
+#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
+#else
+#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
+#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
+#endif
+
+#define SERIAL_PORT_DFNS                       \
+       /* UART CLK   PORT IRQ     FLAGS        */                      \
+       { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },      /* ttyS0 */     \
+       { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS },      /* ttyS1 */     \
+       { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS },      /* ttyS2 */     \
+       { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS },     /* ttyS3 */
diff --git a/arch/alpha/include/asm/setup.h b/arch/alpha/include/asm/setup.h
new file mode 100644 (file)
index 0000000..2e023a4
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ALPHA_SETUP_H
+#define __ALPHA_SETUP_H
+
+#define COMMAND_LINE_SIZE      256
+
+#endif
diff --git a/arch/alpha/include/asm/sfp-machine.h b/arch/alpha/include/asm/sfp-machine.h
new file mode 100644 (file)
index 0000000..5fe63af
--- /dev/null
@@ -0,0 +1,82 @@
+/* Machine-dependent software floating-point definitions.
+   Alpha kernel version.
+   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson (rth@cygnus.com),
+                 Jakub Jelinek (jakub@redhat.com) and
+                 David S. Miller (davem@redhat.com).
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, write to the Free Software Foundation, Inc.,
+   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef _SFP_MACHINE_H
+#define _SFP_MACHINE_H
+   
+#define _FP_W_TYPE_SIZE                64
+#define _FP_W_TYPE             unsigned long
+#define _FP_WS_TYPE            signed long
+#define _FP_I_TYPE             long
+
+#define _FP_MUL_MEAT_S(R,X,Y)                                  \
+  _FP_MUL_MEAT_1_imm(_FP_WFRACBITS_S,R,X,Y)
+#define _FP_MUL_MEAT_D(R,X,Y)                                  \
+  _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_Q(R,X,Y)                                  \
+  _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
+#define _FP_DIV_MEAT_S(R,X,Y)  _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
+#define _FP_DIV_MEAT_D(R,X,Y)  _FP_DIV_MEAT_1_udiv(D,R,X,Y)
+#define _FP_DIV_MEAT_Q(R,X,Y)  _FP_DIV_MEAT_2_udiv(Q,R,X,Y)
+
+#define _FP_NANFRAC_S          _FP_QNANBIT_S
+#define _FP_NANFRAC_D          _FP_QNANBIT_D
+#define _FP_NANFRAC_Q          _FP_QNANBIT_Q
+#define _FP_NANSIGN_S          1
+#define _FP_NANSIGN_D          1
+#define _FP_NANSIGN_Q          1
+
+#define _FP_KEEPNANFRACP 1
+
+/* Alpha Architecture Handbook, 4.7.10.4 sais that
+ * we should prefer any type of NaN in Fb, then Fa.
+ */
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)                     \
+  do {                                                         \
+    R##_s = Y##_s;                                             \
+    _FP_FRAC_COPY_##wc(R,X);                                   \
+    R##_c = FP_CLS_NAN;                                                \
+  } while (0)
+
+/* Obtain the current rounding mode. */
+#define FP_ROUNDMODE   mode
+#define FP_RND_NEAREST (FPCR_DYN_NORMAL >> FPCR_DYN_SHIFT)
+#define FP_RND_ZERO    (FPCR_DYN_CHOPPED >> FPCR_DYN_SHIFT)
+#define FP_RND_PINF    (FPCR_DYN_PLUS >> FPCR_DYN_SHIFT)
+#define FP_RND_MINF    (FPCR_DYN_MINUS >> FPCR_DYN_SHIFT)
+
+/* Exception flags. */
+#define FP_EX_INVALID          IEEE_TRAP_ENABLE_INV
+#define FP_EX_OVERFLOW         IEEE_TRAP_ENABLE_OVF
+#define FP_EX_UNDERFLOW                IEEE_TRAP_ENABLE_UNF
+#define FP_EX_DIVZERO          IEEE_TRAP_ENABLE_DZE
+#define FP_EX_INEXACT          IEEE_TRAP_ENABLE_INE
+#define FP_EX_DENORM           IEEE_TRAP_ENABLE_DNO
+
+#define FP_DENORM_ZERO         (swcr & IEEE_MAP_DMZ)
+
+/* We write the results always */
+#define FP_INHIBIT_RESULTS 0
+
+#endif
diff --git a/arch/alpha/include/asm/shmbuf.h b/arch/alpha/include/asm/shmbuf.h
new file mode 100644 (file)
index 0000000..37ee84f
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef _ALPHA_SHMBUF_H
+#define _ALPHA_SHMBUF_H
+
+/* 
+ * The shmid64_ds structure for alpha architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
+ *
+ * Pad space is left for:
+ * - 2 miscellaneous 64-bit values
+ */
+
+struct shmid64_ds {
+       struct ipc64_perm       shm_perm;       /* operation perms */
+       size_t                  shm_segsz;      /* size of segment (bytes) */
+       __kernel_time_t         shm_atime;      /* last attach time */
+       __kernel_time_t         shm_dtime;      /* last detach time */
+       __kernel_time_t         shm_ctime;      /* last change time */
+       __kernel_pid_t          shm_cpid;       /* pid of creator */
+       __kernel_pid_t          shm_lpid;       /* pid of last operator */
+       unsigned long           shm_nattch;     /* no. of current attaches */
+       unsigned long           __unused1;
+       unsigned long           __unused2;
+};
+
+struct shminfo64 {
+       unsigned long   shmmax;
+       unsigned long   shmmin;
+       unsigned long   shmmni;
+       unsigned long   shmseg;
+       unsigned long   shmall;
+       unsigned long   __unused1;
+       unsigned long   __unused2;
+       unsigned long   __unused3;
+       unsigned long   __unused4;
+};
+
+#endif /* _ALPHA_SHMBUF_H */
diff --git a/arch/alpha/include/asm/shmparam.h b/arch/alpha/include/asm/shmparam.h
new file mode 100644 (file)
index 0000000..cc901d5
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _ASMAXP_SHMPARAM_H
+#define _ASMAXP_SHMPARAM_H
+
+#define        SHMLBA PAGE_SIZE                 /* attach addr a multiple of this */
+
+#endif /* _ASMAXP_SHMPARAM_H */
diff --git a/arch/alpha/include/asm/sigcontext.h b/arch/alpha/include/asm/sigcontext.h
new file mode 100644 (file)
index 0000000..323cdb0
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef _ASMAXP_SIGCONTEXT_H
+#define _ASMAXP_SIGCONTEXT_H
+
+struct sigcontext {
+       /*
+        * What should we have here? I'd probably better use the same
+        * stack layout as OSF/1, just in case we ever want to try
+        * running their binaries.. 
+        *
+        * This is the basic layout, but I don't know if we'll ever
+        * actually fill in all the values..
+        */
+        long           sc_onstack;
+        long           sc_mask;
+        long           sc_pc;
+        long           sc_ps;
+        long           sc_regs[32];
+        long           sc_ownedfp;
+        long           sc_fpregs[32];
+        unsigned long  sc_fpcr;
+        unsigned long  sc_fp_control;
+        unsigned long  sc_reserved1, sc_reserved2;
+        unsigned long  sc_ssize;
+        char *         sc_sbase;
+        unsigned long  sc_traparg_a0;
+        unsigned long  sc_traparg_a1;
+        unsigned long  sc_traparg_a2;
+        unsigned long  sc_fp_trap_pc;
+        unsigned long  sc_fp_trigger_sum;
+        unsigned long  sc_fp_trigger_inst;
+};
+
+
+#endif
diff --git a/arch/alpha/include/asm/siginfo.h b/arch/alpha/include/asm/siginfo.h
new file mode 100644 (file)
index 0000000..9822362
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef _ALPHA_SIGINFO_H
+#define _ALPHA_SIGINFO_H
+
+#define __ARCH_SI_PREAMBLE_SIZE                (4 * sizeof(int))
+#define __ARCH_SI_TRAPNO
+
+#include <asm-generic/siginfo.h>
+
+#endif
diff --git a/arch/alpha/include/asm/signal.h b/arch/alpha/include/asm/signal.h
new file mode 100644 (file)
index 0000000..13c2305
--- /dev/null
@@ -0,0 +1,172 @@
+#ifndef _ASMAXP_SIGNAL_H
+#define _ASMAXP_SIGNAL_H
+
+#include <linux/types.h>
+
+/* Avoid too many header ordering problems.  */
+struct siginfo;
+
+#ifdef __KERNEL__
+/* Digital Unix defines 64 signals.  Most things should be clean enough
+   to redefine this at will, if care is taken to make libc match.  */
+
+#define _NSIG          64
+#define _NSIG_BPW      64
+#define _NSIG_WORDS    (_NSIG / _NSIG_BPW)
+
+typedef unsigned long old_sigset_t;            /* at least 32 bits */
+
+typedef struct {
+       unsigned long sig[_NSIG_WORDS];
+} sigset_t;
+
+#else
+/* Here we must cater to libcs that poke about in kernel headers.  */
+
+#define NSIG           32
+typedef unsigned long sigset_t;
+
+#endif /* __KERNEL__ */
+
+
+/*
+ * Linux/AXP has different signal numbers that Linux/i386: I'm trying
+ * to make it OSF/1 binary compatible, at least for normal binaries.
+ */
+#define SIGHUP          1
+#define SIGINT          2
+#define SIGQUIT                 3
+#define SIGILL          4
+#define SIGTRAP                 5
+#define SIGABRT                 6
+#define SIGEMT          7
+#define SIGFPE          8
+#define SIGKILL                 9
+#define SIGBUS         10
+#define SIGSEGV                11
+#define SIGSYS         12
+#define SIGPIPE                13
+#define SIGALRM                14
+#define SIGTERM                15
+#define SIGURG         16
+#define SIGSTOP                17
+#define SIGTSTP                18
+#define SIGCONT                19
+#define SIGCHLD                20
+#define SIGTTIN                21
+#define SIGTTOU                22
+#define SIGIO          23
+#define SIGXCPU                24
+#define SIGXFSZ                25
+#define SIGVTALRM      26
+#define SIGPROF                27
+#define SIGWINCH       28
+#define SIGINFO                29
+#define SIGUSR1                30
+#define SIGUSR2                31
+
+#define SIGPOLL        SIGIO
+#define SIGPWR SIGINFO
+#define SIGIOT SIGABRT
+
+/* These should not be considered constants from userland.  */
+#define SIGRTMIN       32
+#define SIGRTMAX       _NSIG
+
+/*
+ * SA_FLAGS values:
+ *
+ * SA_ONSTACK indicates that a registered stack_t will be used.
+ * SA_RESTART flag to get restarting signals (which were the default long ago)
+ * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
+ * SA_RESETHAND clears the handler when the signal is delivered.
+ * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
+ * SA_NODEFER prevents the current signal from being masked in the handler.
+ *
+ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
+ * Unix names RESETHAND and NODEFER respectively.
+ */
+
+#define SA_ONSTACK     0x00000001
+#define SA_RESTART     0x00000002
+#define SA_NOCLDSTOP   0x00000004
+#define SA_NODEFER     0x00000008
+#define SA_RESETHAND   0x00000010
+#define SA_NOCLDWAIT   0x00000020
+#define SA_SIGINFO     0x00000040
+
+#define SA_ONESHOT     SA_RESETHAND
+#define SA_NOMASK      SA_NODEFER
+
+/* 
+ * sigaltstack controls
+ */
+#define SS_ONSTACK     1
+#define SS_DISABLE     2
+
+#define MINSIGSTKSZ    4096
+#define SIGSTKSZ       16384
+
+#define SIG_BLOCK          1   /* for blocking signals */
+#define SIG_UNBLOCK        2   /* for unblocking signals */
+#define SIG_SETMASK        3   /* for setting the signal mask */
+
+#include <asm-generic/signal.h>
+
+#ifdef __KERNEL__
+struct osf_sigaction {
+       __sighandler_t  sa_handler;
+       old_sigset_t    sa_mask;
+       int             sa_flags;
+};
+
+struct sigaction {
+       __sighandler_t  sa_handler;
+       unsigned long   sa_flags;
+       sigset_t        sa_mask;        /* mask last for extensibility */
+};
+
+struct k_sigaction {
+       struct sigaction sa;
+       __sigrestore_t ka_restorer;
+};
+#else
+/* Here we must cater to libcs that poke about in kernel headers.  */
+
+struct sigaction {
+       union {
+         __sighandler_t        _sa_handler;
+         void (*_sa_sigaction)(int, struct siginfo *, void *);
+       } _u;
+       sigset_t        sa_mask;
+       int             sa_flags;
+};
+
+#define sa_handler     _u._sa_handler
+#define sa_sigaction   _u._sa_sigaction
+
+#endif /* __KERNEL__ */
+
+typedef struct sigaltstack {
+       void __user *ss_sp;
+       int ss_flags;
+       size_t ss_size;
+} stack_t;
+
+/* sigstack(2) is deprecated, and will be withdrawn in a future version
+   of the X/Open CAE Specification.  Use sigaltstack instead.  It is only
+   implemented here for OSF/1 compatibility.  */
+
+struct sigstack {
+       void __user *ss_sp;
+       int ss_onstack;
+};
+
+#ifdef __KERNEL__
+#include <asm/sigcontext.h>
+
+#define ptrace_signal_deliver(regs, cookie) do { } while (0)
+
+#endif
+
+#endif
diff --git a/arch/alpha/include/asm/smp.h b/arch/alpha/include/asm/smp.h
new file mode 100644 (file)
index 0000000..544c69a
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef __ASM_SMP_H
+#define __ASM_SMP_H
+
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <linux/bitops.h>
+#include <asm/pal.h>
+
+/* HACK: Cabrio WHAMI return value is bogus if more than 8 bits used.. :-( */
+
+static __inline__ unsigned char
+__hard_smp_processor_id(void)
+{
+       register unsigned char __r0 __asm__("$0");
+       __asm__ __volatile__(
+               "call_pal %1 #whami"
+               : "=r"(__r0)
+               :"i" (PAL_whami)
+               : "$1", "$22", "$23", "$24", "$25");
+       return __r0;
+}
+
+#ifdef CONFIG_SMP
+
+#include <asm/irq.h>
+
+struct cpuinfo_alpha {
+       unsigned long loops_per_jiffy;
+       unsigned long last_asn;
+       int need_new_asn;
+       int asn_lock;
+       unsigned long ipi_count;
+       unsigned long prof_multiplier;
+       unsigned long prof_counter;
+       unsigned char mcheck_expected;
+       unsigned char mcheck_taken;
+       unsigned char mcheck_extra;
+} __attribute__((aligned(64)));
+
+extern struct cpuinfo_alpha cpu_data[NR_CPUS];
+
+#define PROC_CHANGE_PENALTY     20
+
+#define hard_smp_processor_id()        __hard_smp_processor_id()
+#define raw_smp_processor_id() (current_thread_info()->cpu)
+
+extern int smp_num_cpus;
+#define cpu_possible_map       cpu_present_map
+
+extern void arch_send_call_function_single_ipi(int cpu);
+extern void arch_send_call_function_ipi(cpumask_t mask);
+
+#else /* CONFIG_SMP */
+
+#define hard_smp_processor_id()                0
+#define smp_call_function_on_cpu(func,info,wait,cpu)    ({ 0; })
+
+#endif /* CONFIG_SMP */
+
+#define NO_PROC_ID     (-1)
+
+#endif
diff --git a/arch/alpha/include/asm/socket.h b/arch/alpha/include/asm/socket.h
new file mode 100644 (file)
index 0000000..a1057c2
--- /dev/null
@@ -0,0 +1,70 @@
+#ifndef _ASM_SOCKET_H
+#define _ASM_SOCKET_H
+
+#include <asm/sockios.h>
+
+/* For setsockopt(2) */
+/*
+ * Note: we only bother about making the SOL_SOCKET options
+ * same as OSF/1, as that's all that "normal" programs are
+ * likely to set.  We don't necessarily want to be binary
+ * compatible with _everything_. 
+ */
+#define SOL_SOCKET     0xffff
+
+#define SO_DEBUG       0x0001
+#define SO_REUSEADDR   0x0004
+#define SO_KEEPALIVE   0x0008
+#define SO_DONTROUTE   0x0010
+#define SO_BROADCAST   0x0020
+#define SO_LINGER      0x0080
+#define SO_OOBINLINE   0x0100
+/* To add :#define SO_REUSEPORT 0x0200 */
+
+#define SO_TYPE                0x1008
+#define SO_ERROR       0x1007
+#define SO_SNDBUF      0x1001
+#define SO_RCVBUF      0x1002
+#define SO_SNDBUFFORCE 0x100a
+#define SO_RCVBUFFORCE 0x100b
+#define        SO_RCVLOWAT     0x1010
+#define        SO_SNDLOWAT     0x1011
+#define        SO_RCVTIMEO     0x1012
+#define        SO_SNDTIMEO     0x1013
+#define SO_ACCEPTCONN  0x1014
+
+/* linux-specific, might as well be the same as on i386 */
+#define SO_NO_CHECK    11
+#define SO_PRIORITY    12
+#define SO_BSDCOMPAT   14
+
+#define SO_PASSCRED    17
+#define SO_PEERCRED    18
+#define SO_BINDTODEVICE 25
+
+/* Socket filtering */
+#define SO_ATTACH_FILTER        26
+#define SO_DETACH_FILTER        27
+
+#define SO_PEERNAME            28
+#define SO_TIMESTAMP           29
+#define SCM_TIMESTAMP          SO_TIMESTAMP
+
+#define SO_PEERSEC             30
+#define SO_PASSSEC             34
+#define SO_TIMESTAMPNS         35
+#define SCM_TIMESTAMPNS                SO_TIMESTAMPNS
+
+/* Security levels - as per NRL IPv6 - don't actually do anything */
+#define SO_SECURITY_AUTHENTICATION             19
+#define SO_SECURITY_ENCRYPTION_TRANSPORT       20
+#define SO_SECURITY_ENCRYPTION_NETWORK         21
+
+#define SO_MARK                        36
+
+/* O_NONBLOCK clashes with the bits used for socket types.  Therefore we
+ * have to define SOCK_NONBLOCK to a different value here.
+ */
+#define SOCK_NONBLOCK  0x40000000
+
+#endif /* _ASM_SOCKET_H */
diff --git a/arch/alpha/include/asm/sockios.h b/arch/alpha/include/asm/sockios.h
new file mode 100644 (file)
index 0000000..7932c7a
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef _ASM_ALPHA_SOCKIOS_H
+#define _ASM_ALPHA_SOCKIOS_H
+
+/* Socket-level I/O control calls. */
+
+#define FIOGETOWN      _IOR('f', 123, int)
+#define FIOSETOWN      _IOW('f', 124, int)
+
+#define SIOCATMARK     _IOR('s', 7, int)
+#define SIOCSPGRP      _IOW('s', 8, pid_t)
+#define SIOCGPGRP      _IOR('s', 9, pid_t)
+
+#define SIOCGSTAMP     0x8906          /* Get stamp (timeval) */
+#define SIOCGSTAMPNS   0x8907          /* Get stamp (timespec) */
+
+#endif /* _ASM_ALPHA_SOCKIOS_H */
diff --git a/arch/alpha/include/asm/spinlock.h b/arch/alpha/include/asm/spinlock.h
new file mode 100644 (file)
index 0000000..aeeb125
--- /dev/null
@@ -0,0 +1,173 @@
+#ifndef _ALPHA_SPINLOCK_H
+#define _ALPHA_SPINLOCK_H
+
+#include <asm/system.h>
+#include <linux/kernel.h>
+#include <asm/current.h>
+
+/*
+ * Simple spin lock operations.  There are two variants, one clears IRQ's
+ * on the local processor, one does not.
+ *
+ * We make no fairness assumptions. They have a cost.
+ */
+
+#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
+#define __raw_spin_is_locked(x)        ((x)->lock != 0)
+#define __raw_spin_unlock_wait(x) \
+               do { cpu_relax(); } while ((x)->lock)
+
+static inline void __raw_spin_unlock(raw_spinlock_t * lock)
+{
+       mb();
+       lock->lock = 0;
+}
+
+static inline void __raw_spin_lock(raw_spinlock_t * lock)
+{
+       long tmp;
+
+       __asm__ __volatile__(
+       "1:     ldl_l   %0,%1\n"
+       "       bne     %0,2f\n"
+       "       lda     %0,1\n"
+       "       stl_c   %0,%1\n"
+       "       beq     %0,2f\n"
+       "       mb\n"
+       ".subsection 2\n"
+       "2:     ldl     %0,%1\n"
+       "       bne     %0,2b\n"
+       "       br      1b\n"
+       ".previous"
+       : "=&r" (tmp), "=m" (lock->lock)
+       : "m"(lock->lock) : "memory");
+}
+
+static inline int __raw_spin_trylock(raw_spinlock_t *lock)
+{
+       return !test_and_set_bit(0, &lock->lock);
+}
+
+/***********************************************************/
+
+static inline int __raw_read_can_lock(raw_rwlock_t *lock)
+{
+       return (lock->lock & 1) == 0;
+}
+
+static inline int __raw_write_can_lock(raw_rwlock_t *lock)
+{
+       return lock->lock == 0;
+}
+
+static inline void __raw_read_lock(raw_rwlock_t *lock)
+{
+       long regx;
+
+       __asm__ __volatile__(
+       "1:     ldl_l   %1,%0\n"
+       "       blbs    %1,6f\n"
+       "       subl    %1,2,%1\n"
+       "       stl_c   %1,%0\n"
+       "       beq     %1,6f\n"
+       "       mb\n"
+       ".subsection 2\n"
+       "6:     ldl     %1,%0\n"
+       "       blbs    %1,6b\n"
+       "       br      1b\n"
+       ".previous"
+       : "=m" (*lock), "=&r" (regx)
+       : "m" (*lock) : "memory");
+}
+
+static inline void __raw_write_lock(raw_rwlock_t *lock)
+{
+       long regx;
+
+       __asm__ __volatile__(
+       "1:     ldl_l   %1,%0\n"
+       "       bne     %1,6f\n"
+       "       lda     %1,1\n"
+       "       stl_c   %1,%0\n"
+       "       beq     %1,6f\n"
+       "       mb\n"
+       ".subsection 2\n"
+       "6:     ldl     %1,%0\n"
+       "       bne     %1,6b\n"
+       "       br      1b\n"
+       ".previous"
+       : "=m" (*lock), "=&r" (regx)
+       : "m" (*lock) : "memory");
+}
+
+static inline int __raw_read_trylock(raw_rwlock_t * lock)
+{
+       long regx;
+       int success;
+
+       __asm__ __volatile__(
+       "1:     ldl_l   %1,%0\n"
+       "       lda     %2,0\n"
+       "       blbs    %1,2f\n"
+       "       subl    %1,2,%2\n"
+       "       stl_c   %2,%0\n"
+       "       beq     %2,6f\n"
+       "2:     mb\n"
+       ".subsection 2\n"
+       "6:     br      1b\n"
+       ".previous"
+       : "=m" (*lock), "=&r" (regx), "=&r" (success)
+       : "m" (*lock) : "memory");
+
+       return success;
+}
+
+static inline int __raw_write_trylock(raw_rwlock_t * lock)
+{
+       long regx;
+       int success;
+
+       __asm__ __volatile__(
+       "1:     ldl_l   %1,%0\n"
+       "       lda     %2,0\n"
+       "       bne     %1,2f\n"
+       "       lda     %2,1\n"
+       "       stl_c   %2,%0\n"
+       "       beq     %2,6f\n"
+       "2:     mb\n"
+       ".subsection 2\n"
+       "6:     br      1b\n"
+       ".previous"
+       : "=m" (*lock), "=&r" (regx), "=&r" (success)
+       : "m" (*lock) : "memory");
+
+       return success;
+}
+
+static inline void __raw_read_unlock(raw_rwlock_t * lock)
+{
+       long regx;
+       __asm__ __volatile__(
+       "       mb\n"
+       "1:     ldl_l   %1,%0\n"
+       "       addl    %1,2,%1\n"
+       "       stl_c   %1,%0\n"
+       "       beq     %1,6f\n"
+       ".subsection 2\n"
+       "6:     br      1b\n"
+       ".previous"
+       : "=m" (*lock), "=&r" (regx)
+       : "m" (*lock) : "memory");
+}
+
+static inline void __raw_write_unlock(raw_rwlock_t * lock)
+{
+       mb();
+       lock->lock = 0;
+}
+
+#define _raw_spin_relax(lock)  cpu_relax()
+#define _raw_read_relax(lock)  cpu_relax()
+#define _raw_write_relax(lock) cpu_relax()
+
+#endif /* _ALPHA_SPINLOCK_H */
diff --git a/arch/alpha/include/asm/spinlock_types.h b/arch/alpha/include/asm/spinlock_types.h
new file mode 100644 (file)
index 0000000..8141eb5
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef _ALPHA_SPINLOCK_TYPES_H
+#define _ALPHA_SPINLOCK_TYPES_H
+
+#ifndef __LINUX_SPINLOCK_TYPES_H
+# error "please don't include this file directly"
+#endif
+
+typedef struct {
+       volatile unsigned int lock;
+} raw_spinlock_t;
+
+#define __RAW_SPIN_LOCK_UNLOCKED       { 0 }
+
+typedef struct {
+       volatile unsigned int lock;
+} raw_rwlock_t;
+
+#define __RAW_RW_LOCK_UNLOCKED         { 0 }
+
+#endif
diff --git a/arch/alpha/include/asm/stat.h b/arch/alpha/include/asm/stat.h
new file mode 100644 (file)
index 0000000..07ad3e6
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef _ALPHA_STAT_H
+#define _ALPHA_STAT_H
+
+struct stat {
+       unsigned int    st_dev;
+       unsigned int    st_ino;
+       unsigned int    st_mode;
+       unsigned int    st_nlink;
+       unsigned int    st_uid;
+       unsigned int    st_gid;
+       unsigned int    st_rdev;
+       long            st_size;
+       unsigned long   st_atime;
+       unsigned long   st_mtime;
+       unsigned long   st_ctime;
+       unsigned int    st_blksize;
+       unsigned int    st_blocks;
+       unsigned int    st_flags;
+       unsigned int    st_gen;
+};
+
+/* The stat64 structure increases the size of dev_t, blkcnt_t, adds
+   nanosecond resolution times, and padding for expansion.  */
+
+struct stat64 {
+       unsigned long   st_dev;
+       unsigned long   st_ino;
+       unsigned long   st_rdev;
+       long            st_size;
+       unsigned long   st_blocks;
+
+       unsigned int    st_mode;
+       unsigned int    st_uid;
+       unsigned int    st_gid;
+       unsigned int    st_blksize;
+       unsigned int    st_nlink;
+       unsigned int    __pad0;
+
+       unsigned long   st_atime;
+       unsigned long   st_atime_nsec; 
+       unsigned long   st_mtime;
+       unsigned long   st_mtime_nsec;
+       unsigned long   st_ctime;
+       unsigned long   st_ctime_nsec;
+       long            __unused[3];
+};
+
+#endif
diff --git a/arch/alpha/include/asm/statfs.h b/arch/alpha/include/asm/statfs.h
new file mode 100644 (file)
index 0000000..ad15830
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _ALPHA_STATFS_H
+#define _ALPHA_STATFS_H
+
+#include <asm-generic/statfs.h>
+
+#endif
diff --git a/arch/alpha/include/asm/string.h b/arch/alpha/include/asm/string.h
new file mode 100644 (file)
index 0000000..b02b8a2
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef __ALPHA_STRING_H__
+#define __ALPHA_STRING_H__
+
+#ifdef __KERNEL__
+
+/*
+ * GCC of any recent vintage doesn't do stupid things with bcopy.
+ * EGCS 1.1 knows all about expanding memcpy inline, others don't.
+ *
+ * Similarly for a memset with data = 0.
+ */
+
+#define __HAVE_ARCH_MEMCPY
+extern void * memcpy(void *, const void *, size_t);
+#define __HAVE_ARCH_MEMMOVE
+extern void * memmove(void *, const void *, size_t);
+
+/* For backward compatibility with modules.  Unused otherwise.  */
+extern void * __memcpy(void *, const void *, size_t);
+
+#define memcpy __builtin_memcpy
+
+#define __HAVE_ARCH_MEMSET
+extern void * __constant_c_memset(void *, unsigned long, size_t);
+extern void * __memset(void *, int, size_t);
+extern void * memset(void *, int, size_t);
+
+#define memset(s, c, n)                                                            \
+(__builtin_constant_p(c)                                                   \
+ ? (__builtin_constant_p(n) && (c) == 0                                            \
+    ? __builtin_memset((s),0,(n))                                          \
+    : __constant_c_memset((s),0x0101010101010101UL*(unsigned char)(c),(n))) \
+ : __memset((s),(c),(n)))
+
+#define __HAVE_ARCH_STRCPY
+extern char * strcpy(char *,const char *);
+#define __HAVE_ARCH_STRNCPY
+extern char * strncpy(char *, const char *, size_t);
+#define __HAVE_ARCH_STRCAT
+extern char * strcat(char *, const char *);
+#define __HAVE_ARCH_STRNCAT
+extern char * strncat(char *, const char *, size_t);
+#define __HAVE_ARCH_STRCHR
+extern char * strchr(const char *,int);
+#define __HAVE_ARCH_STRRCHR
+extern char * strrchr(const char *,int);
+#define __HAVE_ARCH_STRLEN
+extern size_t strlen(const char *);
+#define __HAVE_ARCH_MEMCHR
+extern void * memchr(const void *, int, size_t);
+
+/* The following routine is like memset except that it writes 16-bit
+   aligned values.  The DEST and COUNT parameters must be even for 
+   correct operation.  */
+
+#define __HAVE_ARCH_MEMSETW
+extern void * __memsetw(void *dest, unsigned short, size_t count);
+
+#define memsetw(s, c, n)                                                \
+(__builtin_constant_p(c)                                                \
+ ? __constant_c_memset((s),0x0001000100010001UL*(unsigned short)(c),(n)) \
+ : __memsetw((s),(c),(n)))
+
+#endif /* __KERNEL__ */
+
+#endif /* __ALPHA_STRING_H__ */
diff --git a/arch/alpha/include/asm/suspend.h b/arch/alpha/include/asm/suspend.h
new file mode 100644 (file)
index 0000000..c7042d5
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __ALPHA_SUSPEND_H
+#define __ALPHA_SUSPEND_H
+
+/* Dummy include. */
+
+#endif  /* __ALPHA_SUSPEND_H */
diff --git a/arch/alpha/include/asm/sysinfo.h b/arch/alpha/include/asm/sysinfo.h
new file mode 100644 (file)
index 0000000..086aba2
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * include/asm-alpha/sysinfo.h
+ */
+
+#ifndef __ASM_ALPHA_SYSINFO_H
+#define __ASM_ALPHA_SYSINFO_H
+
+/* This defines the subset of the OSF/1 getsysinfo/setsysinfo calls
+   that we support.  */
+
+#define GSI_UACPROC                    8
+#define GSI_IEEE_FP_CONTROL            45
+#define GSI_IEEE_STATE_AT_SIGNAL       46
+#define GSI_PROC_TYPE                  60
+#define GSI_GET_HWRPB                  101
+
+#define SSI_NVPAIRS                    1
+#define SSI_IEEE_FP_CONTROL            14
+#define SSI_IEEE_STATE_AT_SIGNAL       15
+#define SSI_IEEE_IGNORE_STATE_AT_SIGNAL        16
+#define SSI_IEEE_RAISE_EXCEPTION       1001    /* linux specific */
+
+#define SSIN_UACPROC                   6
+
+#define UAC_BITMASK                    7
+#define UAC_NOPRINT                    1
+#define UAC_NOFIX                      2
+#define UAC_SIGBUS                     4
+
+
+#ifdef __KERNEL__
+
+/* This is the shift that is applied to the UAC bits as stored in the
+   per-thread flags.  See thread_info.h.  */
+#define UAC_SHIFT                      6
+
+#endif
+
+#endif /* __ASM_ALPHA_SYSINFO_H */
diff --git a/arch/alpha/include/asm/system.h b/arch/alpha/include/asm/system.h
new file mode 100644 (file)
index 0000000..afe20fa
--- /dev/null
@@ -0,0 +1,829 @@
+#ifndef __ALPHA_SYSTEM_H
+#define __ALPHA_SYSTEM_H
+
+#include <asm/pal.h>
+#include <asm/page.h>
+#include <asm/barrier.h>
+
+/*
+ * System defines.. Note that this is included both from .c and .S
+ * files, so it does only defines, not any C code.
+ */
+
+/*
+ * We leave one page for the initial stack page, and one page for
+ * the initial process structure. Also, the console eats 3 MB for
+ * the initial bootloader (one of which we can reclaim later).
+ */
+#define BOOT_PCB       0x20000000
+#define BOOT_ADDR      0x20000000
+/* Remove when official MILO sources have ELF support: */
+#define BOOT_SIZE      (16*1024)
+
+#ifdef CONFIG_ALPHA_LEGACY_START_ADDRESS
+#define KERNEL_START_PHYS      0x300000 /* Old bootloaders hardcoded this.  */
+#else
+#define KERNEL_START_PHYS      0x1000000 /* required: Wildfire/Titan/Marvel */
+#endif
+
+#define KERNEL_START   (PAGE_OFFSET+KERNEL_START_PHYS)
+#define SWAPPER_PGD    KERNEL_START
+#define INIT_STACK     (PAGE_OFFSET+KERNEL_START_PHYS+0x02000)
+#define EMPTY_PGT      (PAGE_OFFSET+KERNEL_START_PHYS+0x04000)
+#define EMPTY_PGE      (PAGE_OFFSET+KERNEL_START_PHYS+0x08000)
+#define ZERO_PGE       (PAGE_OFFSET+KERNEL_START_PHYS+0x0A000)
+
+#define START_ADDR     (PAGE_OFFSET+KERNEL_START_PHYS+0x10000)
+
+/*
+ * This is setup by the secondary bootstrap loader.  Because
+ * the zero page is zeroed out as soon as the vm system is
+ * initialized, we need to copy things out into a more permanent
+ * place.
+ */
+#define PARAM                  ZERO_PGE
+#define COMMAND_LINE           ((char*)(PARAM + 0x0000))
+#define INITRD_START           (*(unsigned long *) (PARAM+0x100))
+#define INITRD_SIZE            (*(unsigned long *) (PARAM+0x108))
+
+#ifndef __ASSEMBLY__
+#include <linux/kernel.h>
+#define AT_VECTOR_SIZE_ARCH 4 /* entries in ARCH_DLINFO */
+
+/*
+ * This is the logout header that should be common to all platforms
+ * (assuming they are running OSF/1 PALcode, I guess).
+ */
+struct el_common {
+       unsigned int    size;           /* size in bytes of logout area */
+       unsigned int    sbz1    : 30;   /* should be zero */
+       unsigned int    err2    :  1;   /* second error */
+       unsigned int    retry   :  1;   /* retry flag */
+       unsigned int    proc_offset;    /* processor-specific offset */
+       unsigned int    sys_offset;     /* system-specific offset */
+       unsigned int    code;           /* machine check code */
+       unsigned int    frame_rev;      /* frame revision */
+};
+
+/* Machine Check Frame for uncorrectable errors (Large format)
+ *      --- This is used to log uncorrectable errors such as
+ *          double bit ECC errors.
+ *      --- These errors are detected by both processor and systems.
+ */
+struct el_common_EV5_uncorrectable_mcheck {
+        unsigned long   shadow[8];        /* Shadow reg. 8-14, 25           */
+        unsigned long   paltemp[24];      /* PAL TEMP REGS.                 */
+        unsigned long   exc_addr;         /* Address of excepting instruction*/
+        unsigned long   exc_sum;          /* Summary of arithmetic traps.   */
+        unsigned long   exc_mask;         /* Exception mask (from exc_sum). */
+        unsigned long   pal_base;         /* Base address for PALcode.      */
+        unsigned long   isr;              /* Interrupt Status Reg.          */
+        unsigned long   icsr;             /* CURRENT SETUP OF EV5 IBOX      */
+        unsigned long   ic_perr_stat;     /* I-CACHE Reg. <11> set Data parity
+                                                         <12> set TAG parity*/
+        unsigned long   dc_perr_stat;     /* D-CACHE error Reg. Bits set to 1:
+                                                     <2> Data error in bank 0
+                                                     <3> Data error in bank 1
+                                                     <4> Tag error in bank 0
+                                                     <5> Tag error in bank 1 */
+        unsigned long   va;               /* Effective VA of fault or miss. */
+        unsigned long   mm_stat;          /* Holds the reason for D-stream 
+                                             fault or D-cache parity errors */
+        unsigned long   sc_addr;          /* Address that was being accessed
+                                             when EV5 detected Secondary cache
+                                             failure.                 */
+        unsigned long   sc_stat;          /* Helps determine if the error was
+                                             TAG/Data parity(Secondary Cache)*/
+        unsigned long   bc_tag_addr;      /* Contents of EV5 BC_TAG_ADDR    */
+        unsigned long   ei_addr;          /* Physical address of any transfer
+                                             that is logged in EV5 EI_STAT */
+        unsigned long   fill_syndrome;    /* For correcting ECC errors.     */
+        unsigned long   ei_stat;          /* Helps identify reason of any 
+                                             processor uncorrectable error
+                                             at its external interface.     */
+        unsigned long   ld_lock;          /* Contents of EV5 LD_LOCK register*/
+};
+
+struct el_common_EV6_mcheck {
+       unsigned int FrameSize;         /* Bytes, including this field */
+       unsigned int FrameFlags;        /* <31> = Retry, <30> = Second Error */
+       unsigned int CpuOffset;         /* Offset to CPU-specific info */
+       unsigned int SystemOffset;      /* Offset to system-specific info */
+       unsigned int MCHK_Code;
+       unsigned int MCHK_Frame_Rev;
+       unsigned long I_STAT;           /* EV6 Internal Processor Registers */
+       unsigned long DC_STAT;          /* (See the 21264 Spec) */
+       unsigned long C_ADDR;
+       unsigned long DC1_SYNDROME;
+       unsigned long DC0_SYNDROME;
+       unsigned long C_STAT;
+       unsigned long C_STS;
+       unsigned long MM_STAT;
+       unsigned long EXC_ADDR;
+       unsigned long IER_CM;
+       unsigned long ISUM;
+       unsigned long RESERVED0;
+       unsigned long PAL_BASE;
+       unsigned long I_CTL;
+       unsigned long PCTX;
+};
+
+extern void halt(void) __attribute__((noreturn));
+#define __halt() __asm__ __volatile__ ("call_pal %0 #halt" : : "i" (PAL_halt))
+
+#define switch_to(P,N,L)                                                \
+  do {                                                                  \
+    (L) = alpha_switch_to(virt_to_phys(&task_thread_info(N)->pcb), (P)); \
+    check_mmu_context();                                                \
+  } while (0)
+
+struct task_struct;
+extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*);
+
+#define imb() \
+__asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory")
+
+#define draina() \
+__asm__ __volatile__ ("call_pal %0 #draina" : : "i" (PAL_draina) : "memory")
+
+enum implver_enum {
+       IMPLVER_EV4,
+       IMPLVER_EV5,
+       IMPLVER_EV6
+};
+
+#ifdef CONFIG_ALPHA_GENERIC
+#define implver()                              \
+({ unsigned long __implver;                    \
+   __asm__ ("implver %0" : "=r"(__implver));   \
+   (enum implver_enum) __implver; })
+#else
+/* Try to eliminate some dead code.  */
+#ifdef CONFIG_ALPHA_EV4
+#define implver() IMPLVER_EV4
+#endif
+#ifdef CONFIG_ALPHA_EV5
+#define implver() IMPLVER_EV5
+#endif
+#if defined(CONFIG_ALPHA_EV6)
+#define implver() IMPLVER_EV6
+#endif
+#endif
+
+enum amask_enum {
+       AMASK_BWX = (1UL << 0),
+       AMASK_FIX = (1UL << 1),
+       AMASK_CIX = (1UL << 2),
+       AMASK_MAX = (1UL << 8),
+       AMASK_PRECISE_TRAP = (1UL << 9),
+};
+
+#define amask(mask)                                            \
+({ unsigned long __amask, __input = (mask);                    \
+   __asm__ ("amask %1,%0" : "=r"(__amask) : "rI"(__input));    \
+   __amask; })
+
+#define __CALL_PAL_R0(NAME, TYPE)                              \
+extern inline TYPE NAME(void)                                  \
+{                                                              \
+       register TYPE __r0 __asm__("$0");                       \
+       __asm__ __volatile__(                                   \
+               "call_pal %1 # " #NAME                          \
+               :"=r" (__r0)                                    \
+               :"i" (PAL_ ## NAME)                             \
+               :"$1", "$16", "$22", "$23", "$24", "$25");      \
+       return __r0;                                            \
+}
+
+#define __CALL_PAL_W1(NAME, TYPE0)                             \
+extern inline void NAME(TYPE0 arg0)                            \
+{                                                              \
+       register TYPE0 __r16 __asm__("$16") = arg0;             \
+       __asm__ __volatile__(                                   \
+               "call_pal %1 # "#NAME                           \
+               : "=r"(__r16)                                   \
+               : "i"(PAL_ ## NAME), "0"(__r16)                 \
+               : "$1", "$22", "$23", "$24", "$25");            \
+}
+
+#define __CALL_PAL_W2(NAME, TYPE0, TYPE1)                      \
+extern inline void NAME(TYPE0 arg0, TYPE1 arg1)                        \
+{                                                              \
+       register TYPE0 __r16 __asm__("$16") = arg0;             \
+       register TYPE1 __r17 __asm__("$17") = arg1;             \
+       __asm__ __volatile__(                                   \
+               "call_pal %2 # "#NAME                           \
+               : "=r"(__r16), "=r"(__r17)                      \
+               : "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17)     \
+               : "$1", "$22", "$23", "$24", "$25");            \
+}
+
+#define __CALL_PAL_RW1(NAME, RTYPE, TYPE0)                     \
+extern inline RTYPE NAME(TYPE0 arg0)                           \
+{                                                              \
+       register RTYPE __r0 __asm__("$0");                      \
+       register TYPE0 __r16 __asm__("$16") = arg0;             \
+       __asm__ __volatile__(                                   \
+               "call_pal %2 # "#NAME                           \
+               : "=r"(__r16), "=r"(__r0)                       \
+               : "i"(PAL_ ## NAME), "0"(__r16)                 \
+               : "$1", "$22", "$23", "$24", "$25");            \
+       return __r0;                                            \
+}
+
+#define __CALL_PAL_RW2(NAME, RTYPE, TYPE0, TYPE1)              \
+extern inline RTYPE NAME(TYPE0 arg0, TYPE1 arg1)               \
+{                                                              \
+       register RTYPE __r0 __asm__("$0");                      \
+       register TYPE0 __r16 __asm__("$16") = arg0;             \
+       register TYPE1 __r17 __asm__("$17") = arg1;             \
+       __asm__ __volatile__(                                   \
+               "call_pal %3 # "#NAME                           \
+               : "=r"(__r16), "=r"(__r17), "=r"(__r0)          \
+               : "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17)     \
+               : "$1", "$22", "$23", "$24", "$25");            \
+       return __r0;                                            \
+}
+
+__CALL_PAL_W1(cflush, unsigned long);
+__CALL_PAL_R0(rdmces, unsigned long);
+__CALL_PAL_R0(rdps, unsigned long);
+__CALL_PAL_R0(rdusp, unsigned long);
+__CALL_PAL_RW1(swpipl, unsigned long, unsigned long);
+__CALL_PAL_R0(whami, unsigned long);
+__CALL_PAL_W2(wrent, void*, unsigned long);
+__CALL_PAL_W1(wripir, unsigned long);
+__CALL_PAL_W1(wrkgp, unsigned long);
+__CALL_PAL_W1(wrmces, unsigned long);
+__CALL_PAL_RW2(wrperfmon, unsigned long, unsigned long, unsigned long);
+__CALL_PAL_W1(wrusp, unsigned long);
+__CALL_PAL_W1(wrvptptr, unsigned long);
+
+#define IPL_MIN                0
+#define IPL_SW0                1
+#define IPL_SW1                2
+#define IPL_DEV0       3
+#define IPL_DEV1       4
+#define IPL_TIMER      5
+#define IPL_PERF       6
+#define IPL_POWERFAIL  6
+#define IPL_MCHECK     7
+#define IPL_MAX                7
+
+#ifdef CONFIG_ALPHA_BROKEN_IRQ_MASK
+#undef IPL_MIN
+#define IPL_MIN                __min_ipl
+extern int __min_ipl;
+#endif
+
+#define getipl()               (rdps() & 7)
+#define setipl(ipl)            ((void) swpipl(ipl))
+
+#define local_irq_disable()                    do { setipl(IPL_MAX); barrier(); } while(0)
+#define local_irq_enable()                     do { barrier(); setipl(IPL_MIN); } while(0)
+#define local_save_flags(flags)        ((flags) = rdps())
+#define local_irq_save(flags)  do { (flags) = swpipl(IPL_MAX); barrier(); } while(0)
+#define local_irq_restore(flags)       do { barrier(); setipl(flags); barrier(); } while(0)
+
+#define irqs_disabled()        (getipl() == IPL_MAX)
+
+/*
+ * TB routines..
+ */
+#define __tbi(nr,arg,arg1...)                                  \
+({                                                             \
+       register unsigned long __r16 __asm__("$16") = (nr);     \
+       register unsigned long __r17 __asm__("$17"); arg;       \
+       __asm__ __volatile__(                                   \
+               "call_pal %3 #__tbi"                            \
+               :"=r" (__r16),"=r" (__r17)                      \
+               :"0" (__r16),"i" (PAL_tbi) ,##arg1              \
+               :"$0", "$1", "$22", "$23", "$24", "$25");       \
+})
+
+#define tbi(x,y)       __tbi(x,__r17=(y),"1" (__r17))
+#define tbisi(x)       __tbi(1,__r17=(x),"1" (__r17))
+#define tbisd(x)       __tbi(2,__r17=(x),"1" (__r17))
+#define tbis(x)                __tbi(3,__r17=(x),"1" (__r17))
+#define tbiap()                __tbi(-1, /* no second argument */)
+#define tbia()         __tbi(-2, /* no second argument */)
+
+/*
+ * Atomic exchange.
+ * Since it can be used to implement critical sections
+ * it must clobber "memory" (also for interrupts in UP).
+ */
+
+static inline unsigned long
+__xchg_u8(volatile char *m, unsigned long val)
+{
+       unsigned long ret, tmp, addr64;
+
+       __asm__ __volatile__(
+       "       andnot  %4,7,%3\n"
+       "       insbl   %1,%4,%1\n"
+       "1:     ldq_l   %2,0(%3)\n"
+       "       extbl   %2,%4,%0\n"
+       "       mskbl   %2,%4,%2\n"
+       "       or      %1,%2,%2\n"
+       "       stq_c   %2,0(%3)\n"
+       "       beq     %2,2f\n"
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       ".subsection 2\n"
+       "2:     br      1b\n"
+       ".previous"
+       : "=&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (addr64)
+       : "r" ((long)m), "1" (val) : "memory");
+
+       return ret;
+}
+
+static inline unsigned long
+__xchg_u16(volatile short *m, unsigned long val)
+{
+       unsigned long ret, tmp, addr64;
+
+       __asm__ __volatile__(
+       "       andnot  %4,7,%3\n"
+       "       inswl   %1,%4,%1\n"
+       "1:     ldq_l   %2,0(%3)\n"
+       "       extwl   %2,%4,%0\n"
+       "       mskwl   %2,%4,%2\n"
+       "       or      %1,%2,%2\n"
+       "       stq_c   %2,0(%3)\n"
+       "       beq     %2,2f\n"
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       ".subsection 2\n"
+       "2:     br      1b\n"
+       ".previous"
+       : "=&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (addr64)
+       : "r" ((long)m), "1" (val) : "memory");
+
+       return ret;
+}
+
+static inline unsigned long
+__xchg_u32(volatile int *m, unsigned long val)
+{
+       unsigned long dummy;
+
+       __asm__ __volatile__(
+       "1:     ldl_l %0,%4\n"
+       "       bis $31,%3,%1\n"
+       "       stl_c %1,%2\n"
+       "       beq %1,2f\n"
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       : "=&r" (val), "=&r" (dummy), "=m" (*m)
+       : "rI" (val), "m" (*m) : "memory");
+
+       return val;
+}
+
+static inline unsigned long
+__xchg_u64(volatile long *m, unsigned long val)
+{
+       unsigned long dummy;
+
+       __asm__ __volatile__(
+       "1:     ldq_l %0,%4\n"
+       "       bis $31,%3,%1\n"
+       "       stq_c %1,%2\n"
+       "       beq %1,2f\n"
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       : "=&r" (val), "=&r" (dummy), "=m" (*m)
+       : "rI" (val), "m" (*m) : "memory");
+
+       return val;
+}
+
+/* This function doesn't exist, so you'll get a linker error
+   if something tries to do an invalid xchg().  */
+extern void __xchg_called_with_bad_pointer(void);
+
+#define __xchg(ptr, x, size) \
+({ \
+       unsigned long __xchg__res; \
+       volatile void *__xchg__ptr = (ptr); \
+       switch (size) { \
+               case 1: __xchg__res = __xchg_u8(__xchg__ptr, x); break; \
+               case 2: __xchg__res = __xchg_u16(__xchg__ptr, x); break; \
+               case 4: __xchg__res = __xchg_u32(__xchg__ptr, x); break; \
+               case 8: __xchg__res = __xchg_u64(__xchg__ptr, x); break; \
+               default: __xchg_called_with_bad_pointer(); __xchg__res = x; \
+       } \
+       __xchg__res; \
+})
+
+#define xchg(ptr,x)                                                         \
+  ({                                                                        \
+     __typeof__(*(ptr)) _x_ = (x);                                          \
+     (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, sizeof(*(ptr))); \
+  })
+
+static inline unsigned long
+__xchg_u8_local(volatile char *m, unsigned long val)
+{
+       unsigned long ret, tmp, addr64;
+
+       __asm__ __volatile__(
+       "       andnot  %4,7,%3\n"
+       "       insbl   %1,%4,%1\n"
+       "1:     ldq_l   %2,0(%3)\n"
+       "       extbl   %2,%4,%0\n"
+       "       mskbl   %2,%4,%2\n"
+       "       or      %1,%2,%2\n"
+       "       stq_c   %2,0(%3)\n"
+       "       beq     %2,2f\n"
+       ".subsection 2\n"
+       "2:     br      1b\n"
+       ".previous"
+       : "=&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (addr64)
+       : "r" ((long)m), "1" (val) : "memory");
+
+       return ret;
+}
+
+static inline unsigned long
+__xchg_u16_local(volatile short *m, unsigned long val)
+{
+       unsigned long ret, tmp, addr64;
+
+       __asm__ __volatile__(
+       "       andnot  %4,7,%3\n"
+       "       inswl   %1,%4,%1\n"
+       "1:     ldq_l   %2,0(%3)\n"
+       "       extwl   %2,%4,%0\n"
+       "       mskwl   %2,%4,%2\n"
+       "       or      %1,%2,%2\n"
+       "       stq_c   %2,0(%3)\n"
+       "       beq     %2,2f\n"
+       ".subsection 2\n"
+       "2:     br      1b\n"
+       ".previous"
+       : "=&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (addr64)
+       : "r" ((long)m), "1" (val) : "memory");
+
+       return ret;
+}
+
+static inline unsigned long
+__xchg_u32_local(volatile int *m, unsigned long val)
+{
+       unsigned long dummy;
+
+       __asm__ __volatile__(
+       "1:     ldl_l %0,%4\n"
+       "       bis $31,%3,%1\n"
+       "       stl_c %1,%2\n"
+       "       beq %1,2f\n"
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       : "=&r" (val), "=&r" (dummy), "=m" (*m)
+       : "rI" (val), "m" (*m) : "memory");
+
+       return val;
+}
+
+static inline unsigned long
+__xchg_u64_local(volatile long *m, unsigned long val)
+{
+       unsigned long dummy;
+
+       __asm__ __volatile__(
+       "1:     ldq_l %0,%4\n"
+       "       bis $31,%3,%1\n"
+       "       stq_c %1,%2\n"
+       "       beq %1,2f\n"
+       ".subsection 2\n"
+       "2:     br 1b\n"
+       ".previous"
+       : "=&r" (val), "=&r" (dummy), "=m" (*m)
+       : "rI" (val), "m" (*m) : "memory");
+
+       return val;
+}
+
+#define __xchg_local(ptr, x, size) \
+({ \
+       unsigned long __xchg__res; \
+       volatile void *__xchg__ptr = (ptr); \
+       switch (size) { \
+               case 1: __xchg__res = __xchg_u8_local(__xchg__ptr, x); break; \
+               case 2: __xchg__res = __xchg_u16_local(__xchg__ptr, x); break; \
+               case 4: __xchg__res = __xchg_u32_local(__xchg__ptr, x); break; \
+               case 8: __xchg__res = __xchg_u64_local(__xchg__ptr, x); break; \
+               default: __xchg_called_with_bad_pointer(); __xchg__res = x; \
+       } \
+       __xchg__res; \
+})
+
+#define xchg_local(ptr,x)                                                   \
+  ({                                                                        \
+     __typeof__(*(ptr)) _x_ = (x);                                          \
+     (__typeof__(*(ptr))) __xchg_local((ptr), (unsigned long)_x_,           \
+               sizeof(*(ptr))); \
+  })
+
+/* 
+ * Atomic compare and exchange.  Compare OLD with MEM, if identical,
+ * store NEW in MEM.  Return the initial value in MEM.  Success is
+ * indicated by comparing RETURN with OLD.
+ *
+ * The memory barrier should be placed in SMP only when we actually
+ * make the change. If we don't change anything (so if the returned
+ * prev is equal to old) then we aren't acquiring anything new and
+ * we don't need any memory barrier as far I can tell.
+ */
+
+#define __HAVE_ARCH_CMPXCHG 1
+
+static inline unsigned long
+__cmpxchg_u8(volatile char *m, long old, long new)
+{
+       unsigned long prev, tmp, cmp, addr64;
+
+       __asm__ __volatile__(
+       "       andnot  %5,7,%4\n"
+       "       insbl   %1,%5,%1\n"
+       "1:     ldq_l   %2,0(%4)\n"
+       "       extbl   %2,%5,%0\n"
+       "       cmpeq   %0,%6,%3\n"
+       "       beq     %3,2f\n"
+       "       mskbl   %2,%5,%2\n"
+       "       or      %1,%2,%2\n"
+       "       stq_c   %2,0(%4)\n"
+       "       beq     %2,3f\n"
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       "2:\n"
+       ".subsection 2\n"
+       "3:     br      1b\n"
+       ".previous"
+       : "=&r" (prev), "=&r" (new), "=&r" (tmp), "=&r" (cmp), "=&r" (addr64)
+       : "r" ((long)m), "Ir" (old), "1" (new) : "memory");
+
+       return prev;
+}
+
+static inline unsigned long
+__cmpxchg_u16(volatile short *m, long old, long new)
+{
+       unsigned long prev, tmp, cmp, addr64;
+
+       __asm__ __volatile__(
+       "       andnot  %5,7,%4\n"
+       "       inswl   %1,%5,%1\n"
+       "1:     ldq_l   %2,0(%4)\n"
+       "       extwl   %2,%5,%0\n"
+       "       cmpeq   %0,%6,%3\n"
+       "       beq     %3,2f\n"
+       "       mskwl   %2,%5,%2\n"
+       "       or      %1,%2,%2\n"
+       "       stq_c   %2,0(%4)\n"
+       "       beq     %2,3f\n"
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       "2:\n"
+       ".subsection 2\n"
+       "3:     br      1b\n"
+       ".previous"
+       : "=&r" (prev), "=&r" (new), "=&r" (tmp), "=&r" (cmp), "=&r" (addr64)
+       : "r" ((long)m), "Ir" (old), "1" (new) : "memory");
+
+       return prev;
+}
+
+static inline unsigned long
+__cmpxchg_u32(volatile int *m, int old, int new)
+{
+       unsigned long prev, cmp;
+
+       __asm__ __volatile__(
+       "1:     ldl_l %0,%5\n"
+       "       cmpeq %0,%3,%1\n"
+       "       beq %1,2f\n"
+       "       mov %4,%1\n"
+       "       stl_c %1,%2\n"
+       "       beq %1,3f\n"
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       "2:\n"
+       ".subsection 2\n"
+       "3:     br 1b\n"
+       ".previous"
+       : "=&r"(prev), "=&r"(cmp), "=m"(*m)
+       : "r"((long) old), "r"(new), "m"(*m) : "memory");
+
+       return prev;
+}
+
+static inline unsigned long
+__cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
+{
+       unsigned long prev, cmp;
+
+       __asm__ __volatile__(
+       "1:     ldq_l %0,%5\n"
+       "       cmpeq %0,%3,%1\n"
+       "       beq %1,2f\n"
+       "       mov %4,%1\n"
+       "       stq_c %1,%2\n"
+       "       beq %1,3f\n"
+#ifdef CONFIG_SMP
+       "       mb\n"
+#endif
+       "2:\n"
+       ".subsection 2\n"
+       "3:     br 1b\n"
+       ".previous"
+       : "=&r"(prev), "=&r"(cmp), "=m"(*m)
+       : "r"((long) old), "r"(new), "m"(*m) : "memory");
+
+       return prev;
+}
+
+/* This function doesn't exist, so you'll get a linker error
+   if something tries to do an invalid cmpxchg().  */
+extern void __cmpxchg_called_with_bad_pointer(void);
+
+static __always_inline unsigned long
+__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
+{
+       switch (size) {
+               case 1:
+                       return __cmpxchg_u8(ptr, old, new);
+               case 2:
+                       return __cmpxchg_u16(ptr, old, new);
+               case 4:
+                       return __cmpxchg_u32(ptr, old, new);
+               case 8:
+                       return __cmpxchg_u64(ptr, old, new);
+       }
+       __cmpxchg_called_with_bad_pointer();
+       return old;
+}
+
+#define cmpxchg(ptr, o, n)                                              \
+  ({                                                                    \
+     __typeof__(*(ptr)) _o_ = (o);                                      \
+     __typeof__(*(ptr)) _n_ = (n);                                      \
+     (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,          \
+                                   (unsigned long)_n_, sizeof(*(ptr))); \
+  })
+#define cmpxchg64(ptr, o, n)                                            \
+  ({                                                                    \
+       BUILD_BUG_ON(sizeof(*(ptr)) != 8);                               \
+       cmpxchg((ptr), (o), (n));                                        \
+  })
+
+static inline unsigned long
+__cmpxchg_u8_local(volatile char *m, long old, long new)
+{
+       unsigned long prev, tmp, cmp, addr64;
+
+       __asm__ __volatile__(
+       "       andnot  %5,7,%4\n"
+       "       insbl   %1,%5,%1\n"
+       "1:     ldq_l   %2,0(%4)\n"
+       "       extbl   %2,%5,%0\n"
+       "       cmpeq   %0,%6,%3\n"
+       "       beq     %3,2f\n"
+       "       mskbl   %2,%5,%2\n"
+       "       or      %1,%2,%2\n"
+       "       stq_c   %2,0(%4)\n"
+       "       beq     %2,3f\n"
+       "2:\n"
+       ".subsection 2\n"
+       "3:     br      1b\n"
+       ".previous"
+       : "=&r" (prev), "=&r" (new), "=&r" (tmp), "=&r" (cmp), "=&r" (addr64)
+       : "r" ((long)m), "Ir" (old), "1" (new) : "memory");
+
+       return prev;
+}
+
+static inline unsigned long
+__cmpxchg_u16_local(volatile short *m, long old, long new)
+{
+       unsigned long prev, tmp, cmp, addr64;
+
+       __asm__ __volatile__(
+       "       andnot  %5,7,%4\n"
+       "       inswl   %1,%5,%1\n"
+       "1:     ldq_l   %2,0(%4)\n"
+       "       extwl   %2,%5,%0\n"
+       "       cmpeq   %0,%6,%3\n"
+       "       beq     %3,2f\n"
+       "       mskwl   %2,%5,%2\n"
+       "       or      %1,%2,%2\n"
+       "       stq_c   %2,0(%4)\n"
+       "       beq     %2,3f\n"
+       "2:\n"
+       ".subsection 2\n"
+       "3:     br      1b\n"
+       ".previous"
+       : "=&r" (prev), "=&r" (new), "=&r" (tmp), "=&r" (cmp), "=&r" (addr64)
+       : "r" ((long)m), "Ir" (old), "1" (new) : "memory");
+
+       return prev;
+}
+
+static inline unsigned long
+__cmpxchg_u32_local(volatile int *m, int old, int new)
+{
+       unsigned long prev, cmp;
+
+       __asm__ __volatile__(
+       "1:     ldl_l %0,%5\n"
+       "       cmpeq %0,%3,%1\n"
+       "       beq %1,2f\n"
+       "       mov %4,%1\n"
+       "       stl_c %1,%2\n"
+       "       beq %1,3f\n"
+       "2:\n"
+       ".subsection 2\n"
+       "3:     br 1b\n"
+       ".previous"
+       : "=&r"(prev), "=&r"(cmp), "=m"(*m)
+       : "r"((long) old), "r"(new), "m"(*m) : "memory");
+
+       return prev;
+}
+
+static inline unsigned long
+__cmpxchg_u64_local(volatile long *m, unsigned long old, unsigned long new)
+{
+       unsigned long prev, cmp;
+
+       __asm__ __volatile__(
+       "1:     ldq_l %0,%5\n"
+       "       cmpeq %0,%3,%1\n"
+       "       beq %1,2f\n"
+       "       mov %4,%1\n"
+       "       stq_c %1,%2\n"
+       "       beq %1,3f\n"
+       "2:\n"
+       ".subsection 2\n"
+       "3:     br 1b\n"
+       ".previous"
+       : "=&r"(prev), "=&r"(cmp), "=m"(*m)
+       : "r"((long) old), "r"(new), "m"(*m) : "memory");
+
+       return prev;
+}
+
+static __always_inline unsigned long
+__cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
+               int size)
+{
+       switch (size) {
+               case 1:
+                       return __cmpxchg_u8_local(ptr, old, new);
+               case 2:
+                       return __cmpxchg_u16_local(ptr, old, new);
+               case 4:
+                       return __cmpxchg_u32_local(ptr, old, new);
+               case 8:
+                       return __cmpxchg_u64_local(ptr, old, new);
+       }
+       __cmpxchg_called_with_bad_pointer();
+       return old;
+}
+
+#define cmpxchg_local(ptr, o, n)                                        \
+  ({                                                                    \
+     __typeof__(*(ptr)) _o_ = (o);                                      \
+     __typeof__(*(ptr)) _n_ = (n);                                      \
+     (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_,    \
+                                   (unsigned long)_n_, sizeof(*(ptr))); \
+  })
+#define cmpxchg64_local(ptr, o, n)                                      \
+  ({                                                                    \
+       BUILD_BUG_ON(sizeof(*(ptr)) != 8);                               \
+       cmpxchg_local((ptr), (o), (n));                                  \
+  })
+
+
+#endif /* __ASSEMBLY__ */
+
+#define arch_align_stack(x) (x)
+
+#endif
diff --git a/arch/alpha/include/asm/termbits.h b/arch/alpha/include/asm/termbits.h
new file mode 100644 (file)
index 0000000..ad854a4
--- /dev/null
@@ -0,0 +1,200 @@
+#ifndef _ALPHA_TERMBITS_H
+#define _ALPHA_TERMBITS_H
+
+#include <linux/posix_types.h>
+
+typedef unsigned char  cc_t;
+typedef unsigned int   speed_t;
+typedef unsigned int   tcflag_t;
+
+/*
+ * termios type and macro definitions.  Be careful about adding stuff
+ * to this file since it's used in GNU libc and there are strict rules
+ * concerning namespace pollution.
+ */
+
+#define NCCS 19
+struct termios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_cc[NCCS];                /* control characters */
+       cc_t c_line;                    /* line discipline (== c_cc[19]) */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
+/* Alpha has matching termios and ktermios */
+
+struct ktermios {
+       tcflag_t c_iflag;               /* input mode flags */
+       tcflag_t c_oflag;               /* output mode flags */
+       tcflag_t c_cflag;               /* control mode flags */
+       tcflag_t c_lflag;               /* local mode flags */
+       cc_t c_cc[NCCS];                /* control characters */
+       cc_t c_line;                    /* line discipline (== c_cc[19]) */
+       speed_t c_ispeed;               /* input speed */
+       speed_t c_ospeed;               /* output speed */
+};
+
+/* c_cc characters */
+#define VEOF 0
+#define VEOL 1
+#define VEOL2 2
+#define VERASE 3
+#define VWERASE 4
+#define VKILL 5
+#define VREPRINT 6
+#define VSWTC 7
+#define VINTR 8
+#define VQUIT 9
+#define VSUSP 10
+#define VSTART 12
+#define VSTOP 13
+#define VLNEXT 14
+#define VDISCARD 15
+#define VMIN 16
+#define VTIME 17
+
+/* c_iflag bits */
+#define IGNBRK 0000001
+#define BRKINT 0000002
+#define IGNPAR 0000004
+#define PARMRK 0000010
+#define INPCK  0000020
+#define ISTRIP 0000040
+#define INLCR  0000100
+#define IGNCR  0000200
+#define ICRNL  0000400
+#define IXON   0001000
+#define IXOFF  0002000
+#define IXANY  0004000
+#define IUCLC  0010000
+#define IMAXBEL        0020000
+#define IUTF8  0040000
+
+/* c_oflag bits */
+#define OPOST  0000001
+#define ONLCR  0000002
+#define OLCUC  0000004
+
+#define OCRNL  0000010
+#define ONOCR  0000020
+#define ONLRET 0000040
+
+#define OFILL  00000100
+#define OFDEL  00000200
+#define NLDLY  00001400
+#define   NL0  00000000
+#define   NL1  00000400
+#define   NL2  00001000
+#define   NL3  00001400
+#define TABDLY 00006000
+#define   TAB0 00000000
+#define   TAB1 00002000
+#define   TAB2 00004000
+#define   TAB3 00006000
+#define CRDLY  00030000
+#define   CR0  00000000
+#define   CR1  00010000
+#define   CR2  00020000
+#define   CR3  00030000
+#define FFDLY  00040000
+#define   FF0  00000000
+#define   FF1  00040000
+#define BSDLY  00100000
+#define   BS0  00000000
+#define   BS1  00100000
+#define VTDLY  00200000
+#define   VT0  00000000
+#define   VT1  00200000
+#define XTABS  01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
+
+/* c_cflag bit meaning */
+#define CBAUD  0000037
+#define  B0    0000000         /* hang up */
+#define  B50   0000001
+#define  B75   0000002
+#define  B110  0000003
+#define  B134  0000004
+#define  B150  0000005
+#define  B200  0000006
+#define  B300  0000007
+#define  B600  0000010
+#define  B1200 0000011
+#define  B1800 0000012
+#define  B2400 0000013
+#define  B4800 0000014
+#define  B9600 0000015
+#define  B19200        0000016
+#define  B38400        0000017
+#define EXTA B19200
+#define EXTB B38400
+#define CBAUDEX 0000000
+#define  B57600   00020
+#define  B115200  00021
+#define  B230400  00022
+#define  B460800  00023
+#define  B500000  00024
+#define  B576000  00025
+#define  B921600  00026
+#define B1000000  00027
+#define B1152000  00030
+#define B1500000  00031
+#define B2000000  00032
+#define B2500000  00033
+#define B3000000  00034
+#define B3500000  00035
+#define B4000000  00036
+
+#define CSIZE  00001400
+#define   CS5  00000000
+#define   CS6  00000400
+#define   CS7  00001000
+#define   CS8  00001400
+
+#define CSTOPB 00002000
+#define CREAD  00004000
+#define PARENB 00010000
+#define PARODD 00020000
+#define HUPCL  00040000
+
+#define CLOCAL 00100000
+#define CMSPAR   010000000000          /* mark or space (stick) parity */
+#define CRTSCTS          020000000000          /* flow control */
+
+/* c_lflag bits */
+#define ISIG   0x00000080
+#define ICANON 0x00000100
+#define XCASE  0x00004000
+#define ECHO   0x00000008
+#define ECHOE  0x00000002
+#define ECHOK  0x00000004
+#define ECHONL 0x00000010
+#define NOFLSH 0x80000000
+#define TOSTOP 0x00400000
+#define ECHOCTL        0x00000040
+#define ECHOPRT        0x00000020
+#define ECHOKE 0x00000001
+#define FLUSHO 0x00800000
+#define PENDIN 0x20000000
+#define IEXTEN 0x00000400
+
+/* Values for the ACTION argument to `tcflow'.  */
+#define        TCOOFF          0
+#define        TCOON           1
+#define        TCIOFF          2
+#define        TCION           3
+
+/* Values for the QUEUE_SELECTOR argument to `tcflush'.  */
+#define        TCIFLUSH        0
+#define        TCOFLUSH        1
+#define        TCIOFLUSH       2
+
+/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'.  */
+#define        TCSANOW         0
+#define        TCSADRAIN       1
+#define        TCSAFLUSH       2
+
+#endif /* _ALPHA_TERMBITS_H */
diff --git a/arch/alpha/include/asm/termios.h b/arch/alpha/include/asm/termios.h
new file mode 100644 (file)
index 0000000..fa13716
--- /dev/null
@@ -0,0 +1,146 @@
+#ifndef _ALPHA_TERMIOS_H
+#define _ALPHA_TERMIOS_H
+
+#include <asm/ioctls.h>
+#include <asm/termbits.h>
+
+struct sgttyb {
+       char    sg_ispeed;
+       char    sg_ospeed;
+       char    sg_erase;
+       char    sg_kill;
+       short   sg_flags;
+};
+
+struct tchars {
+       char    t_intrc;
+       char    t_quitc;
+       char    t_startc;
+       char    t_stopc;
+       char    t_eofc;
+       char    t_brkc;
+};
+
+struct ltchars {
+       char    t_suspc;
+       char    t_dsuspc;
+       char    t_rprntc;
+       char    t_flushc;
+       char    t_werasc;
+       char    t_lnextc;
+};
+
+struct winsize {
+       unsigned short ws_row;
+       unsigned short ws_col;
+       unsigned short ws_xpixel;
+       unsigned short ws_ypixel;
+};
+
+#define NCC 8
+struct termio {
+       unsigned short c_iflag;         /* input mode flags */
+       unsigned short c_oflag;         /* output mode flags */
+       unsigned short c_cflag;         /* control mode flags */
+       unsigned short c_lflag;         /* local mode flags */
+       unsigned char c_line;           /* line discipline */
+       unsigned char c_cc[NCC];        /* control characters */
+};
+
+/*
+ * c_cc characters in the termio structure.  Oh, how I love being
+ * backwardly compatible.  Notice that character 4 and 5 are
+ * interpreted differently depending on whether ICANON is set in
+ * c_lflag.  If it's set, they are used as _VEOF and _VEOL, otherwise
+ * as _VMIN and V_TIME.  This is for compatibility with OSF/1 (which
+ * is compatible with sysV)...
+ */
+#define _VINTR 0
+#define _VQUIT 1
+#define _VERASE        2
+#define _VKILL 3
+#define _VEOF  4
+#define _VMIN  4
+#define _VEOL  5
+#define _VTIME 5
+#define _VEOL2 6
+#define _VSWTC 7
+
+#ifdef __KERNEL__
+/*     eof=^D          eol=\0          eol2=\0         erase=del
+       werase=^W       kill=^U         reprint=^R      sxtc=\0
+       intr=^C         quit=^\         susp=^Z         <OSF/1 VDSUSP>
+       start=^Q        stop=^S         lnext=^V        discard=^U
+       vmin=\1         vtime=\0
+*/
+#define INIT_C_CC "\004\000\000\177\027\025\022\000\003\034\032\000\021\023\026\025\001\000"
+
+/*
+ * Translate a "termio" structure into a "termios". Ugh.
+ */
+
+#define user_termio_to_kernel_termios(a_termios, u_termio)                     \
+({                                                                             \
+       struct ktermios *k_termios = (a_termios);                               \
+       struct termio k_termio;                                                 \
+       int canon, ret;                                                         \
+                                                                               \
+       ret = copy_from_user(&k_termio, u_termio, sizeof(k_termio));            \
+       if (!ret) {                                                             \
+               /* Overwrite only the low bits.  */                             \
+               *(unsigned short *)&k_termios->c_iflag = k_termio.c_iflag;      \
+               *(unsigned short *)&k_termios->c_oflag = k_termio.c_oflag;      \
+               *(unsigned short *)&k_termios->c_cflag = k_termio.c_cflag;      \
+               *(unsigned short *)&k_termios->c_lflag = k_termio.c_lflag;      \
+               canon = k_termio.c_lflag & ICANON;                              \
+                                                                               \
+               k_termios->c_cc[VINTR]  = k_termio.c_cc[_VINTR];                \
+               k_termios->c_cc[VQUIT]  = k_termio.c_cc[_VQUIT];                \
+               k_termios->c_cc[VERASE] = k_termio.c_cc[_VERASE];               \
+               k_termios->c_cc[VKILL]  = k_termio.c_cc[_VKILL];                \
+               k_termios->c_cc[VEOL2]  = k_termio.c_cc[_VEOL2];                \
+               k_termios->c_cc[VSWTC]  = k_termio.c_cc[_VSWTC];                \
+               k_termios->c_cc[canon ? VEOF : VMIN]  = k_termio.c_cc[_VEOF];   \
+               k_termios->c_cc[canon ? VEOL : VTIME] = k_termio.c_cc[_VEOL];   \
+       }                                                                       \
+       ret;                                                                    \
+})
+
+/*
+ * Translate a "termios" structure into a "termio". Ugh.
+ *
+ * Note the "fun" _VMIN overloading.
+ */
+#define kernel_termios_to_user_termio(u_termio, a_termios)             \
+({                                                                     \
+       struct ktermios *k_termios = (a_termios);                       \
+       struct termio k_termio;                                         \
+       int canon;                                                      \
+                                                                       \
+       k_termio.c_iflag = k_termios->c_iflag;                          \
+       k_termio.c_oflag = k_termios->c_oflag;                          \
+       k_termio.c_cflag = k_termios->c_cflag;                          \
+       canon = (k_termio.c_lflag = k_termios->c_lflag) & ICANON;       \
+                                                                       \
+       k_termio.c_line = k_termios->c_line;                            \
+       k_termio.c_cc[_VINTR]  = k_termios->c_cc[VINTR];                \
+       k_termio.c_cc[_VQUIT]  = k_termios->c_cc[VQUIT];                \
+       k_termio.c_cc[_VERASE] = k_termios->c_cc[VERASE];               \
+       k_termio.c_cc[_VKILL]  = k_termios->c_cc[VKILL];                \
+       k_termio.c_cc[_VEOF]   = k_termios->c_cc[canon ? VEOF : VMIN];  \
+       k_termio.c_cc[_VEOL]   = k_termios->c_cc[canon ? VEOL : VTIME]; \
+       k_termio.c_cc[_VEOL2]  = k_termios->c_cc[VEOL2];                \
+       k_termio.c_cc[_VSWTC]  = k_termios->c_cc[VSWTC];                \
+                                                                       \
+       copy_to_user(u_termio, &k_termio, sizeof(k_termio));            \
+})
+
+#define user_termios_to_kernel_termios(k, u) \
+       copy_from_user(k, u, sizeof(struct termios))
+
+#define kernel_termios_to_user_termios(u, k) \
+       copy_to_user(u, k, sizeof(struct termios))
+
+#endif /* __KERNEL__ */
+
+#endif /* _ALPHA_TERMIOS_H */
diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h
new file mode 100644 (file)
index 0000000..15fda43
--- /dev/null
@@ -0,0 +1,114 @@
+#ifndef _ALPHA_THREAD_INFO_H
+#define _ALPHA_THREAD_INFO_H
+
+#ifdef __KERNEL__
+
+#ifndef __ASSEMBLY__
+#include <asm/processor.h>
+#include <asm/types.h>
+#include <asm/hwrpb.h>
+#endif
+
+#ifndef __ASSEMBLY__
+struct thread_info {
+       struct pcb_struct       pcb;            /* palcode state */
+
+       struct task_struct      *task;          /* main task structure */
+       unsigned int            flags;          /* low level flags */
+       unsigned int            ieee_state;     /* see fpu.h */
+
+       struct exec_domain      *exec_domain;   /* execution domain */
+       mm_segment_t            addr_limit;     /* thread address space */
+       unsigned                cpu;            /* current CPU */
+       int                     preempt_count; /* 0 => preemptable, <0 => BUG */
+
+       int bpt_nsaved;
+       unsigned long bpt_addr[2];              /* breakpoint handling  */
+       unsigned int bpt_insn[2];
+
+       struct restart_block    restart_block;
+};
+
+/*
+ * Macros/functions for gaining access to the thread information structure.
+ */
+#define INIT_THREAD_INFO(tsk)                  \
+{                                              \
+       .task           = &tsk,                 \
+       .exec_domain    = &default_exec_domain, \
+       .addr_limit     = KERNEL_DS,            \
+       .restart_block = {                      \
+               .fn = do_no_restart_syscall,    \
+       },                                      \
+}
+
+#define init_thread_info       (init_thread_union.thread_info)
+#define init_stack             (init_thread_union.stack)
+
+/* How to get the thread information struct from C.  */
+register struct thread_info *__current_thread_info __asm__("$8");
+#define current_thread_info()  __current_thread_info
+
+/* Thread information allocation.  */
+#define THREAD_SIZE_ORDER 1
+#define THREAD_SIZE (2*PAGE_SIZE)
+
+#endif /* __ASSEMBLY__ */
+
+#define PREEMPT_ACTIVE         0x40000000
+
+/*
+ * Thread information flags:
+ * - these are process state flags and used from assembly
+ * - pending work-to-be-done flags come first to fit in and immediate operand.
+ *
+ * TIF_SYSCALL_TRACE is known to be 0 via blbs.
+ */
+#define TIF_SYSCALL_TRACE      0       /* syscall trace active */
+#define TIF_SIGPENDING         1       /* signal pending */
+#define TIF_NEED_RESCHED       2       /* rescheduling necessary */
+#define TIF_POLLING_NRFLAG     3       /* poll_idle is polling NEED_RESCHED */
+#define TIF_DIE_IF_KERNEL      4       /* dik recursion lock */
+#define TIF_UAC_NOPRINT                5       /* see sysinfo.h */
+#define TIF_UAC_NOFIX          6
+#define TIF_UAC_SIGBUS         7
+#define TIF_MEMDIE             8
+#define TIF_RESTORE_SIGMASK    9       /* restore signal mask in do_signal */
+
+#define _TIF_SYSCALL_TRACE     (1<<TIF_SYSCALL_TRACE)
+#define _TIF_SIGPENDING                (1<<TIF_SIGPENDING)
+#define _TIF_NEED_RESCHED      (1<<TIF_NEED_RESCHED)
+#define _TIF_POLLING_NRFLAG    (1<<TIF_POLLING_NRFLAG)
+#define _TIF_RESTORE_SIGMASK   (1<<TIF_RESTORE_SIGMASK)
+
+/* Work to do on interrupt/exception return.  */
+#define _TIF_WORK_MASK         (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
+
+/* Work to do on any return to userspace.  */
+#define _TIF_ALLWORK_MASK      (_TIF_WORK_MASK         \
+                                | _TIF_SYSCALL_TRACE)
+
+#define ALPHA_UAC_SHIFT                6
+#define ALPHA_UAC_MASK         (1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \
+                                1 << TIF_UAC_SIGBUS)
+
+#define SET_UNALIGN_CTL(task,value)    ({                                   \
+       task_thread_info(task)->flags = ((task_thread_info(task)->flags &    \
+               ~ALPHA_UAC_MASK)                                             \
+               | (((value) << ALPHA_UAC_SHIFT)       & (1<<TIF_UAC_NOPRINT))\
+               | (((value) << (ALPHA_UAC_SHIFT + 1)) & (1<<TIF_UAC_SIGBUS)) \
+               | (((value) << (ALPHA_UAC_SHIFT - 1)) & (1<<TIF_UAC_NOFIX)));\
+       0; })
+
+#define GET_UNALIGN_CTL(task,value)    ({                              \
+       put_user((task_thread_info(task)->flags & (1 << TIF_UAC_NOPRINT))\
+                 >> ALPHA_UAC_SHIFT                                    \
+                | (task_thread_info(task)->flags & (1 << TIF_UAC_SIGBUS))\
+                >> (ALPHA_UAC_SHIFT + 1)                               \
+                | (task_thread_info(task)->flags & (1 << TIF_UAC_NOFIX))\
+                >> (ALPHA_UAC_SHIFT - 1),                              \
+                (int __user *)(value));                                \
+       })
+
+#endif /* __KERNEL__ */
+#endif /* _ALPHA_THREAD_INFO_H */
diff --git a/arch/alpha/include/asm/timex.h b/arch/alpha/include/asm/timex.h
new file mode 100644 (file)
index 0000000..afa0c45
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * linux/include/asm-alpha/timex.h
+ *
+ * ALPHA architecture timex specifications
+ */
+#ifndef _ASMALPHA_TIMEX_H
+#define _ASMALPHA_TIMEX_H
+
+/* With only one or two oddballs, we use the RTC as the ticker, selecting
+   the 32.768kHz reference clock, which nicely divides down to our HZ.  */
+#define CLOCK_TICK_RATE        32768
+
+/*
+ * Standard way to access the cycle counter.
+ * Currently only used on SMP for scheduling.
+ *
+ * Only the low 32 bits are available as a continuously counting entity. 
+ * But this only means we'll force a reschedule every 8 seconds or so,
+ * which isn't an evil thing.
+ */
+
+typedef unsigned int cycles_t;
+
+static inline cycles_t get_cycles (void)
+{
+       cycles_t ret;
+       __asm__ __volatile__ ("rpcc %0" : "=r"(ret));
+       return ret;
+}
+
+#endif
diff --git a/arch/alpha/include/asm/tlb.h b/arch/alpha/include/asm/tlb.h
new file mode 100644 (file)
index 0000000..c136365
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef _ALPHA_TLB_H
+#define _ALPHA_TLB_H
+
+#define tlb_start_vma(tlb, vma)                        do { } while (0)
+#define tlb_end_vma(tlb, vma)                  do { } while (0)
+#define __tlb_remove_tlb_entry(tlb, pte, addr) do { } while (0)
+
+#define tlb_flush(tlb)                         flush_tlb_mm((tlb)->mm)
+
+#include <asm-generic/tlb.h>
+
+#define __pte_free_tlb(tlb, pte)                       pte_free((tlb)->mm, pte)
+#define __pmd_free_tlb(tlb, pmd)                       pmd_free((tlb)->mm, pmd)
+#endif
diff --git a/arch/alpha/include/asm/tlbflush.h b/arch/alpha/include/asm/tlbflush.h
new file mode 100644 (file)
index 0000000..9d87aaa
--- /dev/null
@@ -0,0 +1,151 @@
+#ifndef _ALPHA_TLBFLUSH_H
+#define _ALPHA_TLBFLUSH_H
+
+#include <linux/mm.h>
+#include <asm/compiler.h>
+#include <asm/pgalloc.h>
+
+#ifndef __EXTERN_INLINE
+#define __EXTERN_INLINE extern inline
+#define __MMU_EXTERN_INLINE
+#endif
+
+extern void __load_new_mm_context(struct mm_struct *);
+
+
+/* Use a few helper functions to hide the ugly broken ASN
+   numbers on early Alphas (ev4 and ev45).  */
+
+__EXTERN_INLINE void
+ev4_flush_tlb_current(struct mm_struct *mm)
+{
+       __load_new_mm_context(mm);
+       tbiap();
+}
+
+__EXTERN_INLINE void
+ev5_flush_tlb_current(struct mm_struct *mm)
+{
+       __load_new_mm_context(mm);
+}
+
+/* Flush just one page in the current TLB set.  We need to be very
+   careful about the icache here, there is no way to invalidate a
+   specific icache page.  */
+
+__EXTERN_INLINE void
+ev4_flush_tlb_current_page(struct mm_struct * mm,
+                          struct vm_area_struct *vma,
+                          unsigned long addr)
+{
+       int tbi_flag = 2;
+       if (vma->vm_flags & VM_EXEC) {
+               __load_new_mm_context(mm);
+               tbi_flag = 3;
+       }
+       tbi(tbi_flag, addr);
+}
+
+__EXTERN_INLINE void
+ev5_flush_tlb_current_page(struct mm_struct * mm,
+                          struct vm_area_struct *vma,
+                          unsigned long addr)
+{
+       if (vma->vm_flags & VM_EXEC)
+               __load_new_mm_context(mm);
+       else
+               tbi(2, addr);
+}
+
+
+#ifdef CONFIG_ALPHA_GENERIC
+# define flush_tlb_current             alpha_mv.mv_flush_tlb_current
+# define flush_tlb_current_page                alpha_mv.mv_flush_tlb_current_page
+#else
+# ifdef CONFIG_ALPHA_EV4
+#  define flush_tlb_current            ev4_flush_tlb_current
+#  define flush_tlb_current_page       ev4_flush_tlb_current_page
+# else
+#  define flush_tlb_current            ev5_flush_tlb_current
+#  define flush_tlb_current_page       ev5_flush_tlb_current_page
+# endif
+#endif
+
+#ifdef __MMU_EXTERN_INLINE
+#undef __EXTERN_INLINE
+#undef __MMU_EXTERN_INLINE
+#endif
+
+/* Flush current user mapping.  */
+static inline void
+flush_tlb(void)
+{
+       flush_tlb_current(current->active_mm);
+}
+
+/* Flush someone else's user mapping.  */
+static inline void
+flush_tlb_other(struct mm_struct *mm)
+{
+       unsigned long *mmc = &mm->context[smp_processor_id()];
+       /* Check it's not zero first to avoid cacheline ping pong
+          when possible.  */
+       if (*mmc) *mmc = 0;
+}
+
+#ifndef CONFIG_SMP
+/* Flush everything (kernel mapping may also have changed
+   due to vmalloc/vfree).  */
+static inline void flush_tlb_all(void)
+{
+       tbia();
+}
+
+/* Flush a specified user mapping.  */
+static inline void
+flush_tlb_mm(struct mm_struct *mm)
+{
+       if (mm == current->active_mm)
+               flush_tlb_current(mm);
+       else
+               flush_tlb_other(mm);
+}
+
+/* Page-granular tlb flush.  */
+static inline void
+flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
+{
+       struct mm_struct *mm = vma->vm_mm;
+
+       if (mm == current->active_mm)
+               flush_tlb_current_page(mm, vma, addr);
+       else
+               flush_tlb_other(mm);
+}
+
+/* Flush a specified range of user mapping.  On the Alpha we flush
+   the whole user tlb.  */
+static inline void
+flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
+               unsigned long end)
+{
+       flush_tlb_mm(vma->vm_mm);
+}
+
+#else /* CONFIG_SMP */
+
+extern void flush_tlb_all(void);
+extern void flush_tlb_mm(struct mm_struct *);
+extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
+extern void flush_tlb_range(struct vm_area_struct *, unsigned long,
+                           unsigned long);
+
+#endif /* CONFIG_SMP */
+
+static inline void flush_tlb_kernel_range(unsigned long start,
+                                       unsigned long end)
+{
+       flush_tlb_all();
+}
+
+#endif /* _ALPHA_TLBFLUSH_H */
diff --git a/arch/alpha/include/asm/topology.h b/arch/alpha/include/asm/topology.h
new file mode 100644 (file)
index 0000000..149532e
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef _ASM_ALPHA_TOPOLOGY_H
+#define _ASM_ALPHA_TOPOLOGY_H
+
+#include <linux/smp.h>
+#include <linux/threads.h>
+#include <asm/machvec.h>
+
+#ifdef CONFIG_NUMA
+static inline int cpu_to_node(int cpu)
+{
+       int node;
+       
+       if (!alpha_mv.cpuid_to_nid)
+               return 0;
+
+       node = alpha_mv.cpuid_to_nid(cpu);
+
+#ifdef DEBUG_NUMA
+       BUG_ON(node < 0);
+#endif
+
+       return node;
+}
+
+static inline cpumask_t node_to_cpumask(int node)
+{
+       cpumask_t node_cpu_mask = CPU_MASK_NONE;
+       int cpu;
+
+       for_each_online_cpu(cpu) {
+               if (cpu_to_node(cpu) == node)
+                       cpu_set(cpu, node_cpu_mask);
+       }
+
+#ifdef DEBUG_NUMA
+       printk("node %d: cpu_mask: %016lx\n", node, node_cpu_mask);
+#endif
+
+       return node_cpu_mask;
+}
+
+#define pcibus_to_cpumask(bus) (cpu_online_map)
+
+#endif /* !CONFIG_NUMA */
+# include <asm-generic/topology.h>
+
+#endif /* _ASM_ALPHA_TOPOLOGY_H */
diff --git a/arch/alpha/include/asm/types.h b/arch/alpha/include/asm/types.h
new file mode 100644 (file)
index 0000000..c154135
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef _ALPHA_TYPES_H
+#define _ALPHA_TYPES_H
+
+/*
+ * This file is never included by application software unless
+ * explicitly requested (e.g., via linux/types.h) in which case the
+ * application is Linux specific so (user-) name space pollution is
+ * not a major issue.  However, for interoperability, libraries still
+ * need to be careful to avoid a name clashes.
+ */
+#include <asm-generic/int-l64.h>
+
+#ifndef __ASSEMBLY__
+
+typedef unsigned int umode_t;
+
+#endif /* __ASSEMBLY__ */
+
+/*
+ * These aren't exported outside the kernel to avoid name space clashes
+ */
+#ifdef __KERNEL__
+
+#define BITS_PER_LONG 64
+
+#ifndef __ASSEMBLY__
+
+typedef u64 dma_addr_t;
+typedef u64 dma64_addr_t;
+
+#endif /* __ASSEMBLY__ */
+#endif /* __KERNEL__ */
+#endif /* _ALPHA_TYPES_H */
diff --git a/arch/alpha/include/asm/uaccess.h b/arch/alpha/include/asm/uaccess.h
new file mode 100644 (file)
index 0000000..22de3b4
--- /dev/null
@@ -0,0 +1,511 @@
+#ifndef __ALPHA_UACCESS_H
+#define __ALPHA_UACCESS_H
+
+#include <linux/errno.h>
+#include <linux/sched.h>
+
+
+/*
+ * The fs value determines whether argument validity checking should be
+ * performed or not.  If get_fs() == USER_DS, checking is performed, with
+ * get_fs() == KERNEL_DS, checking is bypassed.
+ *
+ * Or at least it did once upon a time.  Nowadays it is a mask that
+ * defines which bits of the address space are off limits.  This is a
+ * wee bit faster than the above.
+ *
+ * For historical reasons, these macros are grossly misnamed.
+ */
+
+#define KERNEL_DS      ((mm_segment_t) { 0UL })
+#define USER_DS                ((mm_segment_t) { -0x40000000000UL })
+
+#define VERIFY_READ    0
+#define VERIFY_WRITE   1
+
+#define get_fs()  (current_thread_info()->addr_limit)
+#define get_ds()  (KERNEL_DS)
+#define set_fs(x) (current_thread_info()->addr_limit = (x))
+
+#define segment_eq(a,b)        ((a).seg == (b).seg)
+
+/*
+ * Is a address valid? This does a straightforward calculation rather
+ * than tests.
+ *
+ * Address valid if:
+ *  - "addr" doesn't have any high-bits set
+ *  - AND "size" doesn't have any high-bits set
+ *  - AND "addr+size" doesn't have any high-bits set
+ *  - OR we are in kernel mode.
+ */
+#define __access_ok(addr,size,segment) \
+       (((segment).seg & (addr | size | (addr+size))) == 0)
+
+#define access_ok(type,addr,size)                              \
+({                                                             \
+       __chk_user_ptr(addr);                                   \
+       __access_ok(((unsigned long)(addr)),(size),get_fs());   \
+})
+
+/*
+ * These are the main single-value transfer routines.  They automatically
+ * use the right size if we just have the right pointer type.
+ *
+ * As the alpha uses the same address space for kernel and user
+ * data, we can just do these as direct assignments.  (Of course, the
+ * exception handling means that it's no longer "just"...)
+ *
+ * Careful to not
+ * (a) re-use the arguments for side effects (sizeof/typeof is ok)
+ * (b) require any knowledge of processes at this stage
+ */
+#define put_user(x,ptr) \
+  __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)),get_fs())
+#define get_user(x,ptr) \
+  __get_user_check((x),(ptr),sizeof(*(ptr)),get_fs())
+
+/*
+ * The "__xxx" versions do not do address space checking, useful when
+ * doing multiple accesses to the same area (the programmer has to do the
+ * checks by hand with "access_ok()")
+ */
+#define __put_user(x,ptr) \
+  __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
+#define __get_user(x,ptr) \
+  __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
+  
+/*
+ * The "lda %1, 2b-1b(%0)" bits are magic to get the assembler to
+ * encode the bits we need for resolving the exception.  See the
+ * more extensive comments with fixup_inline_exception below for
+ * more information.
+ */
+
+extern void __get_user_unknown(void);
+
+#define __get_user_nocheck(x,ptr,size)                         \
+({                                                             \
+       long __gu_err = 0;                                      \
+       unsigned long __gu_val;                                 \
+       __chk_user_ptr(ptr);                                    \
+       switch (size) {                                         \
+         case 1: __get_user_8(ptr); break;                     \
+         case 2: __get_user_16(ptr); break;                    \
+         case 4: __get_user_32(ptr); break;                    \
+         case 8: __get_user_64(ptr); break;                    \
+         default: __get_user_unknown(); break;                 \
+       }                                                       \
+       (x) = (__typeof__(*(ptr))) __gu_val;                    \
+       __gu_err;                                               \
+})
+
+#define __get_user_check(x,ptr,size,segment)                           \
+({                                                                     \
+       long __gu_err = -EFAULT;                                        \
+       unsigned long __gu_val = 0;                                     \
+       const __typeof__(*(ptr)) __user *__gu_addr = (ptr);             \
+       if (__access_ok((unsigned long)__gu_addr,size,segment)) {       \
+               __gu_err = 0;                                           \
+               switch (size) {                                         \
+                 case 1: __get_user_8(__gu_addr); break;               \
+                 case 2: __get_user_16(__gu_addr); break;              \
+                 case 4: __get_user_32(__gu_addr); break;              \
+                 case 8: __get_user_64(__gu_addr); break;              \
+                 default: __get_user_unknown(); break;                 \
+               }                                                       \
+       }                                                               \
+       (x) = (__typeof__(*(ptr))) __gu_val;                            \
+       __gu_err;                                                       \
+})
+
+struct __large_struct { unsigned long buf[100]; };
+#define __m(x) (*(struct __large_struct __user *)(x))
+
+#define __get_user_64(addr)                            \
+       __asm__("1: ldq %0,%2\n"                        \
+       "2:\n"                                          \
+       ".section __ex_table,\"a\"\n"                   \
+       "       .long 1b - .\n"                         \
+       "       lda %0, 2b-1b(%1)\n"                    \
+       ".previous"                                     \
+               : "=r"(__gu_val), "=r"(__gu_err)        \
+               : "m"(__m(addr)), "1"(__gu_err))
+
+#define __get_user_32(addr)                            \
+       __asm__("1: ldl %0,%2\n"                        \
+       "2:\n"                                          \
+       ".section __ex_table,\"a\"\n"                   \
+       "       .long 1b - .\n"                         \
+       "       lda %0, 2b-1b(%1)\n"                    \
+       ".previous"                                     \
+               : "=r"(__gu_val), "=r"(__gu_err)        \
+               : "m"(__m(addr)), "1"(__gu_err))
+
+#ifdef __alpha_bwx__
+/* Those lucky bastards with ev56 and later CPUs can do byte/word moves.  */
+
+#define __get_user_16(addr)                            \
+       __asm__("1: ldwu %0,%2\n"                       \
+       "2:\n"                                          \
+       ".section __ex_table,\"a\"\n"                   \
+       "       .long 1b - .\n"                         \
+       "       lda %0, 2b-1b(%1)\n"                    \
+       ".previous"                                     \
+               : "=r"(__gu_val), "=r"(__gu_err)        \
+               : "m"(__m(addr)), "1"(__gu_err))
+
+#define __get_user_8(addr)                             \
+       __asm__("1: ldbu %0,%2\n"                       \
+       "2:\n"                                          \
+       ".section __ex_table,\"a\"\n"                   \
+       "       .long 1b - .\n"                         \
+       "       lda %0, 2b-1b(%1)\n"                    \
+       ".previous"                                     \
+               : "=r"(__gu_val), "=r"(__gu_err)        \
+               : "m"(__m(addr)), "1"(__gu_err))
+#else
+/* Unfortunately, we can't get an unaligned access trap for the sub-word
+   load, so we have to do a general unaligned operation.  */
+
+#define __get_user_16(addr)                                            \
+{                                                                      \
+       long __gu_tmp;                                                  \
+       __asm__("1: ldq_u %0,0(%3)\n"                                   \
+       "2:     ldq_u %1,1(%3)\n"                                       \
+       "       extwl %0,%3,%0\n"                                       \
+       "       extwh %1,%3,%1\n"                                       \
+       "       or %0,%1,%0\n"                                          \
+       "3:\n"                                                          \
+       ".section __ex_table,\"a\"\n"                                   \
+       "       .long 1b - .\n"                                         \
+       "       lda %0, 3b-1b(%2)\n"                                    \
+       "       .long 2b - .\n"                                         \
+       "       lda %0, 3b-2b(%2)\n"                                    \
+       ".previous"                                                     \
+               : "=&r"(__gu_val), "=&r"(__gu_tmp), "=r"(__gu_err)      \
+               : "r"(addr), "2"(__gu_err));                            \
+}
+
+#define __get_user_8(addr)                                             \
+       __asm__("1: ldq_u %0,0(%2)\n"                                   \
+       "       extbl %0,%2,%0\n"                                       \
+       "2:\n"                                                          \
+       ".section __ex_table,\"a\"\n"                                   \
+       "       .long 1b - .\n"                                         \
+       "       lda %0, 2b-1b(%1)\n"                                    \
+       ".previous"                                                     \
+               : "=&r"(__gu_val), "=r"(__gu_err)                       \
+               : "r"(addr), "1"(__gu_err))
+#endif
+
+extern void __put_user_unknown(void);
+
+#define __put_user_nocheck(x,ptr,size)                         \
+({                                                             \
+       long __pu_err = 0;                                      \
+       __chk_user_ptr(ptr);                                    \
+       switch (size) {                                         \
+         case 1: __put_user_8(x,ptr); break;                   \
+         case 2: __put_user_16(x,ptr); break;                  \
+         case 4: __put_user_32(x,ptr); break;                  \
+         case 8: __put_user_64(x,ptr); break;                  \
+         default: __put_user_unknown(); break;                 \
+       }                                                       \
+       __pu_err;                                               \
+})
+
+#define __put_user_check(x,ptr,size,segment)                           \
+({                                                                     \
+       long __pu_err = -EFAULT;                                        \
+       __typeof__(*(ptr)) __user *__pu_addr = (ptr);                   \
+       if (__access_ok((unsigned long)__pu_addr,size,segment)) {       \
+               __pu_err = 0;                                           \
+               switch (size) {                                         \
+                 case 1: __put_user_8(x,__pu_addr); break;             \
+                 case 2: __put_user_16(x,__pu_addr); break;            \
+                 case 4: __put_user_32(x,__pu_addr); break;            \
+                 case 8: __put_user_64(x,__pu_addr); break;            \
+                 default: __put_user_unknown(); break;                 \
+               }                                                       \
+       }                                                               \
+       __pu_err;                                                       \
+})
+
+/*
+ * The "__put_user_xx()" macros tell gcc they read from memory
+ * instead of writing: this is because they do not write to
+ * any memory gcc knows about, so there are no aliasing issues
+ */
+#define __put_user_64(x,addr)                                  \
+__asm__ __volatile__("1: stq %r2,%1\n"                         \
+       "2:\n"                                                  \
+       ".section __ex_table,\"a\"\n"                           \
+       "       .long 1b - .\n"                                 \
+       "       lda $31,2b-1b(%0)\n"                            \
+       ".previous"                                             \
+               : "=r"(__pu_err)                                \
+               : "m" (__m(addr)), "rJ" (x), "0"(__pu_err))
+
+#define __put_user_32(x,addr)                                  \
+__asm__ __volatile__("1: stl %r2,%1\n"                         \
+       "2:\n"                                                  \
+       ".section __ex_table,\"a\"\n"                           \
+       "       .long 1b - .\n"                                 \
+       "       lda $31,2b-1b(%0)\n"                            \
+       ".previous"                                             \
+               : "=r"(__pu_err)                                \
+               : "m"(__m(addr)), "rJ"(x), "0"(__pu_err))
+
+#ifdef __alpha_bwx__
+/* Those lucky bastards with ev56 and later CPUs can do byte/word moves.  */
+
+#define __put_user_16(x,addr)                                  \
+__asm__ __volatile__("1: stw %r2,%1\n"                         \
+       "2:\n"                                                  \
+       ".section __ex_table,\"a\"\n"                           \
+       "       .long 1b - .\n"                                 \
+       "       lda $31,2b-1b(%0)\n"                            \
+       ".previous"                                             \
+               : "=r"(__pu_err)                                \
+               : "m"(__m(addr)), "rJ"(x), "0"(__pu_err))
+
+#define __put_user_8(x,addr)                                   \
+__asm__ __volatile__("1: stb %r2,%1\n"                         \
+       "2:\n"                                                  \
+       ".section __ex_table,\"a\"\n"                           \
+       "       .long 1b - .\n"                                 \
+       "       lda $31,2b-1b(%0)\n"                            \
+       ".previous"                                             \
+               : "=r"(__pu_err)                                \
+               : "m"(__m(addr)), "rJ"(x), "0"(__pu_err))
+#else
+/* Unfortunately, we can't get an unaligned access trap for the sub-word
+   write, so we have to do a general unaligned operation.  */
+
+#define __put_user_16(x,addr)                                  \
+{                                                              \
+       long __pu_tmp1, __pu_tmp2, __pu_tmp3, __pu_tmp4;        \
+       __asm__ __volatile__(                                   \
+       "1:     ldq_u %2,1(%5)\n"                               \
+       "2:     ldq_u %1,0(%5)\n"                               \
+       "       inswh %6,%5,%4\n"                               \
+       "       inswl %6,%5,%3\n"                               \
+       "       mskwh %2,%5,%2\n"                               \
+       "       mskwl %1,%5,%1\n"                               \
+       "       or %2,%4,%2\n"                                  \
+       "       or %1,%3,%1\n"                                  \
+       "3:     stq_u %2,1(%5)\n"                               \
+       "4:     stq_u %1,0(%5)\n"                               \
+       "5:\n"                                                  \
+       ".section __ex_table,\"a\"\n"                           \
+       "       .long 1b - .\n"                                 \
+       "       lda $31, 5b-1b(%0)\n"                           \
+       "       .long 2b - .\n"                                 \
+       "       lda $31, 5b-2b(%0)\n"                           \
+       "       .long 3b - .\n"                                 \
+       "       lda $31, 5b-3b(%0)\n"                           \
+       "       .long 4b - .\n"                                 \
+       "       lda $31, 5b-4b(%0)\n"                           \
+       ".previous"                                             \
+               : "=r"(__pu_err), "=&r"(__pu_tmp1),             \
+                 "=&r"(__pu_tmp2), "=&r"(__pu_tmp3),           \
+                 "=&r"(__pu_tmp4)                              \
+               : "r"(addr), "r"((unsigned long)(x)), "0"(__pu_err)); \
+}
+
+#define __put_user_8(x,addr)                                   \
+{                                                              \
+       long __pu_tmp1, __pu_tmp2;                              \
+       __asm__ __volatile__(                                   \
+       "1:     ldq_u %1,0(%4)\n"                               \
+       "       insbl %3,%4,%2\n"                               \
+       "       mskbl %1,%4,%1\n"                               \
+       "       or %1,%2,%1\n"                                  \
+       "2:     stq_u %1,0(%4)\n"                               \
+       "3:\n"                                                  \
+       ".section __ex_table,\"a\"\n"                           \
+       "       .long 1b - .\n"                                 \
+       "       lda $31, 3b-1b(%0)\n"                           \
+       "       .long 2b - .\n"                                 \
+       "       lda $31, 3b-2b(%0)\n"                           \
+       ".previous"                                             \
+               : "=r"(__pu_err),                               \
+                 "=&r"(__pu_tmp1), "=&r"(__pu_tmp2)            \
+               : "r"((unsigned long)(x)), "r"(addr), "0"(__pu_err)); \
+}
+#endif
+
+
+/*
+ * Complex access routines
+ */
+
+/* This little bit of silliness is to get the GP loaded for a function
+   that ordinarily wouldn't.  Otherwise we could have it done by the macro
+   directly, which can be optimized the linker.  */
+#ifdef MODULE
+#define __module_address(sym)          "r"(sym),
+#define __module_call(ra, arg, sym)    "jsr $" #ra ",(%" #arg ")," #sym
+#else
+#define __module_address(sym)
+#define __module_call(ra, arg, sym)    "bsr $" #ra "," #sym " !samegp"
+#endif
+
+extern void __copy_user(void);
+
+extern inline long
+__copy_tofrom_user_nocheck(void *to, const void *from, long len)
+{
+       register void * __cu_to __asm__("$6") = to;
+       register const void * __cu_from __asm__("$7") = from;
+       register long __cu_len __asm__("$0") = len;
+
+       __asm__ __volatile__(
+               __module_call(28, 3, __copy_user)
+               : "=r" (__cu_len), "=r" (__cu_from), "=r" (__cu_to)
+               : __module_address(__copy_user)
+                 "0" (__cu_len), "1" (__cu_from), "2" (__cu_to)
+               : "$1","$2","$3","$4","$5","$28","memory");
+
+       return __cu_len;
+}
+
+extern inline long
+__copy_tofrom_user(void *to, const void *from, long len, const void __user *validate)
+{
+       if (__access_ok((unsigned long)validate, len, get_fs()))
+               len = __copy_tofrom_user_nocheck(to, from, len);
+       return len;
+}
+
+#define __copy_to_user(to,from,n)                                      \
+({                                                                     \
+       __chk_user_ptr(to);                                             \
+       __copy_tofrom_user_nocheck((__force void *)(to),(from),(n));    \
+})
+#define __copy_from_user(to,from,n)                                    \
+({                                                                     \
+       __chk_user_ptr(from);                                           \
+       __copy_tofrom_user_nocheck((to),(__force void *)(from),(n));    \
+})
+
+#define __copy_to_user_inatomic __copy_to_user
+#define __copy_from_user_inatomic __copy_from_user
+
+
+extern inline long
+copy_to_user(void __user *to, const void *from, long n)
+{
+       return __copy_tofrom_user((__force void *)to, from, n, to);
+}
+
+extern inline long
+copy_from_user(void *to, const void __user *from, long n)
+{
+       return __copy_tofrom_user(to, (__force void *)from, n, from);
+}
+
+extern void __do_clear_user(void);
+
+extern inline long
+__clear_user(void __user *to, long len)
+{
+       register void __user * __cl_to __asm__("$6") = to;
+       register long __cl_len __asm__("$0") = len;
+       __asm__ __volatile__(
+               __module_call(28, 2, __do_clear_user)
+               : "=r"(__cl_len), "=r"(__cl_to)
+               : __module_address(__do_clear_user)
+                 "0"(__cl_len), "1"(__cl_to)
+               : "$1","$2","$3","$4","$5","$28","memory");
+       return __cl_len;
+}
+
+extern inline long
+clear_user(void __user *to, long len)
+{
+       if (__access_ok((unsigned long)to, len, get_fs()))
+               len = __clear_user(to, len);
+       return len;
+}
+
+#undef __module_address
+#undef __module_call
+
+/* Returns: -EFAULT if exception before terminator, N if the entire
+   buffer filled, else strlen.  */
+
+extern long __strncpy_from_user(char *__to, const char __user *__from, long __to_len);
+
+extern inline long
+strncpy_from_user(char *to, const char __user *from, long n)
+{
+       long ret = -EFAULT;
+       if (__access_ok((unsigned long)from, 0, get_fs()))
+               ret = __strncpy_from_user(to, from, n);
+       return ret;
+}
+
+/* Returns: 0 if bad, string length+1 (memory size) of string if ok */
+extern long __strlen_user(const char __user *);
+
+extern inline long strlen_user(const char __user *str)
+{
+       return access_ok(VERIFY_READ,str,0) ? __strlen_user(str) : 0;
+}
+
+/* Returns: 0 if exception before NUL or reaching the supplied limit (N),
+ * a value greater than N if the limit would be exceeded, else strlen.  */
+extern long __strnlen_user(const char __user *, long);
+
+extern inline long strnlen_user(const char __user *str, long n)
+{
+       return access_ok(VERIFY_READ,str,0) ? __strnlen_user(str, n) : 0;
+}
+
+/*
+ * About the exception table:
+ *
+ * - insn is a 32-bit pc-relative offset from the faulting insn.
+ * - nextinsn is a 16-bit offset off of the faulting instruction
+ *   (not off of the *next* instruction as branches are).
+ * - errreg is the register in which to place -EFAULT.
+ * - valreg is the final target register for the load sequence
+ *   and will be zeroed.
+ *
+ * Either errreg or valreg may be $31, in which case nothing happens.
+ *
+ * The exception fixup information "just so happens" to be arranged
+ * as in a MEM format instruction.  This lets us emit our three
+ * values like so:
+ *
+ *      lda valreg, nextinsn(errreg)
+ *
+ */
+
+struct exception_table_entry
+{
+       signed int insn;
+       union exception_fixup {
+               unsigned unit;
+               struct {
+                       signed int nextinsn : 16;
+                       unsigned int errreg : 5;
+                       unsigned int valreg : 5;
+               } bits;
+       } fixup;
+};
+
+/* Returns the new pc */
+#define fixup_exception(map_reg, fixup, pc)                    \
+({                                                             \
+       if ((fixup)->fixup.bits.valreg != 31)                   \
+               map_reg((fixup)->fixup.bits.valreg) = 0;        \
+       if ((fixup)->fixup.bits.errreg != 31)                   \
+               map_reg((fixup)->fixup.bits.errreg) = -EFAULT;  \
+       (pc) + (fixup)->fixup.bits.nextinsn;                    \
+})
+
+
+#endif /* __ALPHA_UACCESS_H */
diff --git a/arch/alpha/include/asm/ucontext.h b/arch/alpha/include/asm/ucontext.h
new file mode 100644 (file)
index 0000000..47578ab
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef _ASMAXP_UCONTEXT_H
+#define _ASMAXP_UCONTEXT_H
+
+struct ucontext {
+       unsigned long     uc_flags;
+       struct ucontext  *uc_link;
+       old_sigset_t      uc_osf_sigmask;
+       stack_t           uc_stack;
+       struct sigcontext uc_mcontext;
+       sigset_t          uc_sigmask;   /* mask last for extensibility */
+};
+
+#endif /* !_ASMAXP_UCONTEXT_H */
diff --git a/arch/alpha/include/asm/unaligned.h b/arch/alpha/include/asm/unaligned.h
new file mode 100644 (file)
index 0000000..3787c60
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef _ASM_ALPHA_UNALIGNED_H
+#define _ASM_ALPHA_UNALIGNED_H
+
+#include <linux/unaligned/le_struct.h>
+#include <linux/unaligned/be_byteshift.h>
+#include <linux/unaligned/generic.h>
+
+#define get_unaligned __get_unaligned_le
+#define put_unaligned __put_unaligned_le
+
+#endif /* _ASM_ALPHA_UNALIGNED_H */
diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h
new file mode 100644 (file)
index 0000000..5b5c174
--- /dev/null
@@ -0,0 +1,464 @@
+#ifndef _ALPHA_UNISTD_H
+#define _ALPHA_UNISTD_H
+
+#define __NR_osf_syscall         0     /* not implemented */
+#define __NR_exit                1
+#define __NR_fork                2
+#define __NR_read                3
+#define __NR_write               4
+#define __NR_osf_old_open        5     /* not implemented */
+#define __NR_close               6
+#define __NR_osf_wait4           7
+#define __NR_osf_old_creat       8     /* not implemented */
+#define __NR_link                9
+#define __NR_unlink             10
+#define __NR_osf_execve                 11     /* not implemented */
+#define __NR_chdir              12
+#define __NR_fchdir             13
+#define __NR_mknod              14
+#define __NR_chmod              15
+#define __NR_chown              16
+#define __NR_brk                17
+#define __NR_osf_getfsstat      18     /* not implemented */
+#define __NR_lseek              19
+#define __NR_getxpid            20
+#define __NR_osf_mount          21
+#define __NR_umount             22
+#define __NR_setuid             23
+#define __NR_getxuid            24
+#define __NR_exec_with_loader   25     /* not implemented */
+#define __NR_ptrace             26
+#define __NR_osf_nrecvmsg       27     /* not implemented */
+#define __NR_osf_nsendmsg       28     /* not implemented */
+#define __NR_osf_nrecvfrom      29     /* not implemented */
+#define __NR_osf_naccept        30     /* not implemented */
+#define __NR_osf_ngetpeername   31     /* not implemented */
+#define __NR_osf_ngetsockname   32     /* not implemented */
+#define __NR_access             33
+#define __NR_osf_chflags        34     /* not implemented */
+#define __NR_osf_fchflags       35     /* not implemented */
+#define __NR_sync               36
+#define __NR_kill               37
+#define __NR_osf_old_stat       38     /* not implemented */
+#define __NR_setpgid            39
+#define __NR_osf_old_lstat      40     /* not implemented */
+#define __NR_dup                41
+#define __NR_pipe               42
+#define __NR_osf_set_program_attributes        43
+#define __NR_osf_profil                 44     /* not implemented */
+#define __NR_open               45
+#define __NR_osf_old_sigaction  46     /* not implemented */
+#define __NR_getxgid            47
+#define __NR_osf_sigprocmask    48
+#define __NR_osf_getlogin       49     /* not implemented */
+#define __NR_osf_setlogin       50     /* not implemented */
+#define __NR_acct               51
+#define __NR_sigpending                 52
+
+#define __NR_ioctl              54
+#define __NR_osf_reboot                 55     /* not implemented */
+#define __NR_osf_revoke                 56     /* not implemented */
+#define __NR_symlink            57
+#define __NR_readlink           58
+#define __NR_execve             59
+#define __NR_umask              60
+#define __NR_chroot             61
+#define __NR_osf_old_fstat      62     /* not implemented */
+#define __NR_getpgrp            63
+#define __NR_getpagesize        64
+#define __NR_osf_mremap                 65     /* not implemented */
+#define __NR_vfork              66
+#define __NR_stat               67
+#define __NR_lstat              68
+#define __NR_osf_sbrk           69     /* not implemented */
+#define __NR_osf_sstk           70     /* not implemented */
+#define __NR_mmap               71     /* OSF/1 mmap is superset of Linux */
+#define __NR_osf_old_vadvise    72     /* not implemented */
+#define __NR_munmap             73
+#define __NR_mprotect           74
+#define __NR_madvise            75
+#define __NR_vhangup            76
+#define __NR_osf_kmodcall       77     /* not implemented */
+#define __NR_osf_mincore        78     /* not implemented */
+#define __NR_getgroups          79
+#define __NR_setgroups          80
+#define __NR_osf_old_getpgrp    81     /* not implemented */
+#define __NR_setpgrp            82     /* BSD alias for setpgid */
+#define __NR_osf_setitimer      83
+#define __NR_osf_old_wait       84     /* not implemented */
+#define __NR_osf_table          85     /* not implemented */
+#define __NR_osf_getitimer      86
+#define __NR_gethostname        87
+#define __NR_sethostname        88
+#define __NR_getdtablesize      89
+#define __NR_dup2               90
+#define __NR_fstat              91
+#define __NR_fcntl              92
+#define __NR_osf_select                 93
+#define __NR_poll               94
+#define __NR_fsync              95
+#define __NR_setpriority        96
+#define __NR_socket             97
+#define __NR_connect            98
+#define __NR_accept             99
+#define __NR_getpriority       100
+#define __NR_send              101
+#define __NR_recv              102
+#define __NR_sigreturn         103
+#define __NR_bind              104
+#define __NR_setsockopt                105
+#define __NR_listen            106
+#define __NR_osf_plock         107     /* not implemented */
+#define __NR_osf_old_sigvec    108     /* not implemented */
+#define __NR_osf_old_sigblock  109     /* not implemented */
+#define __NR_osf_old_sigsetmask        110     /* not implemented */
+#define __NR_sigsuspend                111
+#define __NR_osf_sigstack      112
+#define __NR_recvmsg           113
+#define __NR_sendmsg           114
+#define __NR_osf_old_vtrace    115     /* not implemented */
+#define __NR_osf_gettimeofday  116
+#define __NR_osf_getrusage     117
+#define __NR_getsockopt                118
+
+#define __NR_readv             120
+#define __NR_writev            121
+#define __NR_osf_settimeofday  122
+#define __NR_fchown            123
+#define __NR_fchmod            124
+#define __NR_recvfrom          125
+#define __NR_setreuid          126
+#define __NR_setregid          127
+#define __NR_rename            128
+#define __NR_truncate          129
+#define __NR_ftruncate         130
+#define __NR_flock             131
+#define __NR_setgid            132
+#define __NR_sendto            133
+#define __NR_shutdown          134
+#define __NR_socketpair                135
+#define __NR_mkdir             136
+#define __NR_rmdir             137
+#define __NR_osf_utimes                138
+#define __NR_osf_old_sigreturn 139     /* not implemented */
+#define __NR_osf_adjtime       140     /* not implemented */
+#define __NR_getpeername       141
+#define __NR_osf_gethostid     142     /* not implemented */
+#define __NR_osf_sethostid     143     /* not implemented */
+#define __NR_getrlimit         144
+#define __NR_setrlimit         145
+#define __NR_osf_old_killpg    146     /* not implemented */
+#define __NR_setsid            147
+#define __NR_quotactl          148
+#define __NR_osf_oldquota      149     /* not implemented */
+#define __NR_getsockname       150
+
+#define __NR_osf_pid_block     153     /* not implemented */
+#define __NR_osf_pid_unblock   154     /* not implemented */
+
+#define __NR_sigaction         156
+#define __NR_osf_sigwaitprim   157     /* not implemented */
+#define __NR_osf_nfssvc                158     /* not implemented */
+#define __NR_osf_getdirentries 159
+#define __NR_osf_statfs                160
+#define __NR_osf_fstatfs       161
+
+#define __NR_osf_asynch_daemon 163     /* not implemented */
+#define __NR_osf_getfh         164     /* not implemented */   
+#define __NR_osf_getdomainname 165
+#define __NR_setdomainname     166
+
+#define __NR_osf_exportfs      169     /* not implemented */
+
+#define __NR_osf_alt_plock     181     /* not implemented */
+
+#define __NR_osf_getmnt                184     /* not implemented */
+
+#define __NR_osf_alt_sigpending        187     /* not implemented */
+#define __NR_osf_alt_setsid    188     /* not implemented */
+
+#define __NR_osf_swapon                199
+#define __NR_msgctl            200
+#define __NR_msgget            201
+#define __NR_msgrcv            202
+#define __NR_msgsnd            203
+#define __NR_semctl            204
+#define __NR_semget            205
+#define __NR_semop             206
+#define __NR_osf_utsname       207
+#define __NR_lchown            208
+#define __NR_osf_shmat         209
+#define __NR_shmctl            210
+#define __NR_shmdt             211
+#define __NR_shmget            212
+#define __NR_osf_mvalid                213     /* not implemented */
+#define __NR_osf_getaddressconf        214     /* not implemented */
+#define __NR_osf_msleep                215     /* not implemented */
+#define __NR_osf_mwakeup       216     /* not implemented */
+#define __NR_msync             217
+#define __NR_osf_signal                218     /* not implemented */
+#define __NR_osf_utc_gettime   219     /* not implemented */
+#define __NR_osf_utc_adjtime   220     /* not implemented */
+
+#define __NR_osf_security      222     /* not implemented */
+#define __NR_osf_kloadcall     223     /* not implemented */
+
+#define __NR_getpgid           233
+#define __NR_getsid            234
+#define __NR_sigaltstack       235
+#define __NR_osf_waitid                236     /* not implemented */
+#define __NR_osf_priocntlset   237     /* not implemented */
+#define __NR_osf_sigsendset    238     /* not implemented */
+#define __NR_osf_set_speculative       239     /* not implemented */
+#define __NR_osf_msfs_syscall  240     /* not implemented */
+#define __NR_osf_sysinfo       241
+#define __NR_osf_uadmin                242     /* not implemented */
+#define __NR_osf_fuser         243     /* not implemented */
+#define __NR_osf_proplist_syscall    244
+#define __NR_osf_ntp_adjtime   245     /* not implemented */
+#define __NR_osf_ntp_gettime   246     /* not implemented */
+#define __NR_osf_pathconf      247     /* not implemented */
+#define __NR_osf_fpathconf     248     /* not implemented */
+
+#define __NR_osf_uswitch       250     /* not implemented */
+#define __NR_osf_usleep_thread 251
+#define __NR_osf_audcntl       252     /* not implemented */
+#define __NR_osf_audgen                253     /* not implemented */
+#define __NR_sysfs             254
+#define __NR_osf_subsys_info   255     /* not implemented */
+#define __NR_osf_getsysinfo    256
+#define __NR_osf_setsysinfo    257
+#define __NR_osf_afs_syscall   258     /* not implemented */
+#define __NR_osf_swapctl       259     /* not implemented */
+#define __NR_osf_memcntl       260     /* not implemented */
+#define __NR_osf_fdatasync     261     /* not implemented */
+
+/*
+ * Ignore legacy syscalls that we don't use.
+ */
+#define __IGNORE_alarm
+#define __IGNORE_creat
+#define __IGNORE_getegid
+#define __IGNORE_geteuid
+#define __IGNORE_getgid
+#define __IGNORE_getpid
+#define __IGNORE_getppid
+#define __IGNORE_getuid
+#define __IGNORE_pause
+#define __IGNORE_time
+#define __IGNORE_utime
+
+/*
+ * Linux-specific system calls begin at 300
+ */
+#define __NR_bdflush           300
+#define __NR_sethae            301
+#define __NR_mount             302
+#define __NR_old_adjtimex      303
+#define __NR_swapoff           304
+#define __NR_getdents          305
+#define __NR_create_module     306
+#define __NR_init_module       307
+#define __NR_delete_module     308
+#define __NR_get_kernel_syms   309
+#define __NR_syslog            310
+#define __NR_reboot            311
+#define __NR_clone             312
+#define __NR_uselib            313
+#define __NR_mlock             314
+#define __NR_munlock           315
+#define __NR_mlockall          316
+#define __NR_munlockall                317
+#define __NR_sysinfo           318
+#define __NR__sysctl           319
+/* 320 was sys_idle.  */
+#define __NR_oldumount         321
+#define __NR_swapon            322
+#define __NR_times             323
+#define __NR_personality       324
+#define __NR_setfsuid          325
+#define __NR_setfsgid          326
+#define __NR_ustat             327
+#define __NR_statfs            328
+#define __NR_fstatfs           329
+#define __NR_sched_setparam            330
+#define __NR_sched_getparam            331
+#define __NR_sched_setscheduler                332
+#define __NR_sched_getscheduler                333
+#define __NR_sched_yield               334
+#define __NR_sched_get_priority_max    335
+#define __NR_sched_get_priority_min    336
+#define __NR_sched_rr_get_interval     337
+#define __NR_afs_syscall               338
+#define __NR_uname                     339
+#define __NR_nanosleep                 340
+#define __NR_mremap                    341
+#define __NR_nfsservctl                        342
+#define __NR_setresuid                 343
+#define __NR_getresuid                 344
+#define __NR_pciconfig_read            345
+#define __NR_pciconfig_write           346
+#define __NR_query_module              347
+#define __NR_prctl                     348
+#define __NR_pread64                   349
+#define __NR_pwrite64                  350
+#define __NR_rt_sigreturn              351
+#define __NR_rt_sigaction              352
+#define __NR_rt_sigprocmask            353
+#define __NR_rt_sigpending             354
+#define __NR_rt_sigtimedwait           355
+#define __NR_rt_sigqueueinfo           356
+#define __NR_rt_sigsuspend             357
+#define __NR_select                    358
+#define __NR_gettimeofday              359
+#define __NR_settimeofday              360
+#define __NR_getitimer                 361
+#define __NR_setitimer                 362
+#define __NR_utimes                    363
+#define __NR_getrusage                 364
+#define __NR_wait4                     365
+#define __NR_adjtimex                  366
+#define __NR_getcwd                    367
+#define __NR_capget                    368
+#define __NR_capset                    369
+#define __NR_sendfile                  370
+#define __NR_setresgid                 371
+#define __NR_getresgid                 372
+#define __NR_dipc                      373
+#define __NR_pivot_root                        374
+#define __NR_mincore                   375
+#define __NR_pciconfig_iobase          376
+#define __NR_getdents64                        377
+#define __NR_gettid                    378
+#define __NR_readahead                 379
+/* 380 is unused */
+#define __NR_tkill                     381
+#define __NR_setxattr                  382
+#define __NR_lsetxattr                 383
+#define __NR_fsetxattr                 384
+#define __NR_getxattr                  385
+#define __NR_lgetxattr                 386
+#define __NR_fgetxattr                 387
+#define __NR_listxattr                 388
+#define __NR_llistxattr                        389
+#define __NR_flistxattr                        390
+#define __NR_removexattr               391
+#define __NR_lremovexattr              392
+#define __NR_fremovexattr              393
+#define __NR_futex                     394
+#define __NR_sched_setaffinity         395     
+#define __NR_sched_getaffinity         396
+#define __NR_tuxcall                   397
+#define __NR_io_setup                  398
+#define __NR_io_destroy                        399
+#define __NR_io_getevents              400
+#define __NR_io_submit                 401
+#define __NR_io_cancel                 402
+#define __NR_exit_group                        405
+#define __NR_lookup_dcookie            406
+#define __NR_epoll_create              407
+#define __NR_epoll_ctl                 408
+#define __NR_epoll_wait                        409
+/* Feb 2007: These three sys_epoll defines shouldn't be here but culling
+ * them would break userspace apps ... we'll kill them off in 2010 :) */
+#define __NR_sys_epoll_create          __NR_epoll_create
+#define __NR_sys_epoll_ctl             __NR_epoll_ctl
+#define __NR_sys_epoll_wait            __NR_epoll_wait
+#define __NR_remap_file_pages          410
+#define __NR_set_tid_address           411
+#define __NR_restart_syscall           412
+#define __NR_fadvise64                 413
+#define __NR_timer_create              414
+#define __NR_timer_settime             415
+#define __NR_timer_gettime             416
+#define __NR_timer_getoverrun          417
+#define __NR_timer_delete              418
+#define __NR_clock_settime             419
+#define __NR_clock_gettime             420
+#define __NR_clock_getres              421
+#define __NR_clock_nanosleep           422
+#define __NR_semtimedop                        423
+#define __NR_tgkill                    424
+#define __NR_stat64                    425
+#define __NR_lstat64                   426
+#define __NR_fstat64                   427
+#define __NR_vserver                   428
+#define __NR_mbind                     429
+#define __NR_get_mempolicy             430
+#define __NR_set_mempolicy             431
+#define __NR_mq_open                   432
+#define __NR_mq_unlink                 433
+#define __NR_mq_timedsend              434
+#define __NR_mq_timedreceive           435
+#define __NR_mq_notify                 436
+#define __NR_mq_getsetattr             437
+#define __NR_waitid                    438
+#define __NR_add_key                   439
+#define __NR_request_key               440
+#define __NR_keyctl                    441
+#define __NR_ioprio_set                        442
+#define __NR_ioprio_get                        443
+#define __NR_inotify_init              444
+#define __NR_inotify_add_watch         445
+#define __NR_inotify_rm_watch          446
+#define __NR_fdatasync                 447
+#define __NR_kexec_load                        448
+#define __NR_migrate_pages             449
+#define __NR_openat                    450
+#define __NR_mkdirat                   451
+#define __NR_mknodat                   452
+#define __NR_fchownat                  453
+#define __NR_futimesat                 454
+#define __NR_fstatat64                 455
+#define __NR_unlinkat                  456
+#define __NR_renameat                  457
+#define __NR_linkat                    458
+#define __NR_symlinkat                 459
+#define __NR_readlinkat                        460
+#define __NR_fchmodat                  461
+#define __NR_faccessat                 462
+#define __NR_pselect6                  463
+#define __NR_ppoll                     464
+#define __NR_unshare                   465
+#define __NR_set_robust_list           466
+#define __NR_get_robust_list           467
+#define __NR_splice                    468
+#define __NR_sync_file_range           469
+#define __NR_tee                       470
+#define __NR_vmsplice                  471
+#define __NR_move_pages                        472
+#define __NR_getcpu                    473
+#define __NR_epoll_pwait               474
+#define __NR_utimensat                 475
+#define __NR_signalfd                  476
+#define __NR_timerfd                   477
+#define __NR_eventfd                   478
+
+#ifdef __KERNEL__
+
+#define NR_SYSCALLS                    479
+
+#define __ARCH_WANT_IPC_PARSE_VERSION
+#define __ARCH_WANT_OLD_READDIR
+#define __ARCH_WANT_STAT64
+#define __ARCH_WANT_SYS_GETHOSTNAME
+#define __ARCH_WANT_SYS_FADVISE64
+#define __ARCH_WANT_SYS_GETPGRP
+#define __ARCH_WANT_SYS_OLD_GETRLIMIT
+#define __ARCH_WANT_SYS_OLDUMOUNT
+#define __ARCH_WANT_SYS_SIGPENDING
+
+/* "Conditional" syscalls.  What we want is
+
+       __attribute__((weak,alias("sys_ni_syscall")))
+
+   but that raises the problem of what type to give the symbol.  If we use
+   a prototype, it'll conflict with the definition given in this file and
+   others.  If we use __typeof, we discover that not all symbols actually
+   have declarations.  If we use no prototype, then we get warnings from
+   -Wstrict-prototypes.  Ho hum.  */
+
+#define cond_syscall(x)  asm(".weak\t" #x "\n" #x " = sys_ni_syscall")
+
+#endif /* __KERNEL__ */
+#endif /* _ALPHA_UNISTD_H */
diff --git a/arch/alpha/include/asm/user.h b/arch/alpha/include/asm/user.h
new file mode 100644 (file)
index 0000000..a4eb6a4
--- /dev/null
@@ -0,0 +1,53 @@
+#ifndef _ALPHA_USER_H
+#define _ALPHA_USER_H
+
+#include <linux/sched.h>
+#include <linux/ptrace.h>
+
+#include <asm/page.h>
+#include <asm/reg.h>
+
+/*
+ * Core file format: The core file is written in such a way that gdb
+ * can understand it and provide useful information to the user (under
+ * linux we use the `trad-core' bfd, NOT the osf-core).  The file contents
+ * are as follows:
+ *
+ *  upage: 1 page consisting of a user struct that tells gdb
+ *     what is present in the file.  Directly after this is a
+ *     copy of the task_struct, which is currently not used by gdb,
+ *     but it may come in handy at some point.  All of the registers
+ *     are stored as part of the upage.  The upage should always be
+ *     only one page long.
+ *  data: The data segment follows next.  We use current->end_text to
+ *     current->brk to pick up all of the user variables, plus any memory
+ *     that may have been sbrk'ed.  No attempt is made to determine if a
+ *     page is demand-zero or if a page is totally unused, we just cover
+ *     the entire range.  All of the addresses are rounded in such a way
+ *     that an integral number of pages is written.
+ *  stack: We need the stack information in order to get a meaningful
+ *     backtrace.  We need to write the data from usp to
+ *     current->start_stack, so we round each of these in order to be able
+ *     to write an integer number of pages.
+ */
+struct user {
+       unsigned long   regs[EF_SIZE/8+32];     /* integer and fp regs */
+       size_t          u_tsize;                /* text size (pages) */
+       size_t          u_dsize;                /* data size (pages) */
+       size_t          u_ssize;                /* stack size (pages) */
+       unsigned long   start_code;             /* text starting address */
+       unsigned long   start_data;             /* data starting address */
+       unsigned long   start_stack;            /* stack starting address */
+       long int        signal;                 /* signal causing core dump */
+       unsigned long   u_ar0;                  /* help gdb find registers */
+       unsigned long   magic;                  /* identifies a core file */
+       char            u_comm[32];             /* user command name */
+};
+
+#define NBPG                   PAGE_SIZE
+#define UPAGES                 1
+#define HOST_TEXT_START_ADDR   (u.start_code)
+#define HOST_DATA_START_ADDR   (u.start_data)
+#define HOST_STACK_END_ADDR    (u.start_stack + u.u_ssize * NBPG)
+
+#endif /* _ALPHA_USER_H */
diff --git a/arch/alpha/include/asm/vga.h b/arch/alpha/include/asm/vga.h
new file mode 100644 (file)
index 0000000..c00106b
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ *     Access to VGA videoram
+ *
+ *     (c) 1998 Martin Mares <mj@ucw.cz>
+ */
+
+#ifndef _LINUX_ASM_VGA_H_
+#define _LINUX_ASM_VGA_H_
+
+#include <asm/io.h>
+
+#define VT_BUF_HAVE_RW
+#define VT_BUF_HAVE_MEMSETW
+#define VT_BUF_HAVE_MEMCPYW
+
+static inline void scr_writew(u16 val, volatile u16 *addr)
+{
+       if (__is_ioaddr(addr))
+               __raw_writew(val, (volatile u16 __iomem *) addr);
+       else
+               *addr = val;
+}
+
+static inline u16 scr_readw(volatile const u16 *addr)
+{
+       if (__is_ioaddr(addr))
+               return __raw_readw((volatile const u16 __iomem *) addr);
+       else
+               return *addr;
+}
+
+static inline void scr_memsetw(u16 *s, u16 c, unsigned int count)
+{
+       if (__is_ioaddr(s))
+               memsetw_io((u16 __iomem *) s, c, count);
+       else
+               memsetw(s, c, count);
+}
+
+/* Do not trust that the usage will be correct; analyze the arguments.  */
+extern void scr_memcpyw(u16 *d, const u16 *s, unsigned int count);
+
+/* ??? These are currently only used for downloading character sets.  As
+   such, they don't need memory barriers.  Is this all they are intended
+   to be used for?  */
+#define vga_readb(a)   readb((u8 __iomem *)(a))
+#define vga_writeb(v,a)        writeb(v, (u8 __iomem *)(a))
+
+#ifdef CONFIG_VGA_HOSE
+#include <linux/ioport.h>
+#include <linux/pci.h>
+
+extern struct pci_controller *pci_vga_hose;
+
+# define __is_port_vga(a)       \
+       (((a) >= 0x3b0) && ((a) < 0x3e0) && \
+        ((a) != 0x3b3) && ((a) != 0x3d3))
+
+# define __is_mem_vga(a) \
+       (((a) >= 0xa0000) && ((a) <= 0xc0000))
+
+# define FIXUP_IOADDR_VGA(a) do {                       \
+       if (pci_vga_hose && __is_port_vga(a))     \
+               (a) += pci_vga_hose->io_space->start;     \
+ } while(0)
+
+# define FIXUP_MEMADDR_VGA(a) do {                       \
+       if (pci_vga_hose && __is_mem_vga(a))     \
+               (a) += pci_vga_hose->mem_space->start; \
+ } while(0)
+
+#else /* CONFIG_VGA_HOSE */
+# define pci_vga_hose 0
+# define __is_port_vga(a) 0
+# define __is_mem_vga(a) 0
+# define FIXUP_IOADDR_VGA(a)
+# define FIXUP_MEMADDR_VGA(a)
+#endif /* CONFIG_VGA_HOSE */
+
+#define VGA_MAP_MEM(x,s)       ((unsigned long) ioremap(x, s))
+
+#endif
diff --git a/arch/alpha/include/asm/xor.h b/arch/alpha/include/asm/xor.h
new file mode 100644 (file)
index 0000000..5ee1c2b
--- /dev/null
@@ -0,0 +1,855 @@
+/*
+ * include/asm-alpha/xor.h
+ *
+ * Optimized RAID-5 checksumming functions for alpha EV5 and EV6
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * You should have received a copy of the GNU General Public License
+ * (for example /usr/src/linux/COPYING); if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+extern void xor_alpha_2(unsigned long, unsigned long *, unsigned long *);
+extern void xor_alpha_3(unsigned long, unsigned long *, unsigned long *,
+                       unsigned long *);
+extern void xor_alpha_4(unsigned long, unsigned long *, unsigned long *,
+                       unsigned long *, unsigned long *);
+extern void xor_alpha_5(unsigned long, unsigned long *, unsigned long *,
+                       unsigned long *, unsigned long *, unsigned long *);
+
+extern void xor_alpha_prefetch_2(unsigned long, unsigned long *,
+                                unsigned long *);
+extern void xor_alpha_prefetch_3(unsigned long, unsigned long *,
+                                unsigned long *, unsigned long *);
+extern void xor_alpha_prefetch_4(unsigned long, unsigned long *,
+                                unsigned long *, unsigned long *,
+                                unsigned long *);
+extern void xor_alpha_prefetch_5(unsigned long, unsigned long *,
+                                unsigned long *, unsigned long *,
+                                unsigned long *, unsigned long *);
+
+asm("                                                          \n\
+       .text                                                   \n\
+       .align 3                                                \n\
+       .ent xor_alpha_2                                        \n\
+xor_alpha_2:                                                   \n\
+       .prologue 0                                             \n\
+       srl $16, 6, $16                                         \n\
+       .align 4                                                \n\
+2:                                                             \n\
+       ldq $0,0($17)                                           \n\
+       ldq $1,0($18)                                           \n\
+       ldq $2,8($17)                                           \n\
+       ldq $3,8($18)                                           \n\
+                                                               \n\
+       ldq $4,16($17)                                          \n\
+       ldq $5,16($18)                                          \n\
+       ldq $6,24($17)                                          \n\
+       ldq $7,24($18)                                          \n\
+                                                               \n\
+       ldq $19,32($17)                                         \n\
+       ldq $20,32($18)                                         \n\
+       ldq $21,40($17)                                         \n\
+       ldq $22,40($18)                                         \n\
+                                                               \n\
+       ldq $23,48($17)                                         \n\
+       ldq $24,48($18)                                         \n\
+       ldq $25,56($17)                                         \n\
+       xor $0,$1,$0            # 7 cycles from $1 load         \n\
+                                                               \n\
+       ldq $27,56($18)                                         \n\
+       xor $2,$3,$2                                            \n\
+       stq $0,0($17)                                           \n\
+       xor $4,$5,$4                                            \n\
+                                                               \n\
+       stq $2,8($17)                                           \n\
+       xor $6,$7,$6                                            \n\
+       stq $4,16($17)                                          \n\
+       xor $19,$20,$19                                         \n\
+                                                               \n\
+       stq $6,24($17)                                          \n\
+       xor $21,$22,$21                                         \n\
+       stq $19,32($17)                                         \n\
+       xor $23,$24,$23                                         \n\
+                                                               \n\
+       stq $21,40($17)                                         \n\
+       xor $25,$27,$25                                         \n\
+       stq $23,48($17)                                         \n\
+       subq $16,1,$16                                          \n\
+                                                               \n\
+       stq $25,56($17)                                         \n\
+       addq $17,64,$17                                         \n\
+       addq $18,64,$18                                         \n\
+       bgt $16,2b                                              \n\
+                                                               \n\
+       ret                                                     \n\
+       .end xor_alpha_2                                        \n\
+                                                               \n\
+       .align 3                                                \n\
+       .ent xor_alpha_3                                        \n\
+xor_alpha_3:                                                   \n\
+       .prologue 0                                             \n\
+       srl $16, 6, $16                                         \n\
+       .align 4                                                \n\
+3:                                                             \n\
+       ldq $0,0($17)                                           \n\
+       ldq $1,0($18)                                           \n\
+       ldq $2,0($19)                                           \n\
+       ldq $3,8($17)                                           \n\
+                                                               \n\
+       ldq $4,8($18)                                           \n\
+       ldq $6,16($17)                                          \n\
+       ldq $7,16($18)                                          \n\
+       ldq $21,24($17)                                         \n\
+                                                               \n\
+       ldq $22,24($18)                                         \n\
+       ldq $24,32($17)                                         \n\
+       ldq $25,32($18)                                         \n\
+       ldq $5,8($19)                                           \n\
+                                                               \n\
+       ldq $20,16($19)                                         \n\
+       ldq $23,24($19)                                         \n\
+       ldq $27,32($19)                                         \n\
+       nop                                                     \n\
+                                                               \n\
+       xor $0,$1,$1            # 8 cycles from $0 load         \n\
+       xor $3,$4,$4            # 6 cycles from $4 load         \n\
+       xor $6,$7,$7            # 6 cycles from $7 load         \n\
+       xor $21,$22,$22         # 5 cycles from $22 load        \n\
+                                                               \n\
+       xor $1,$2,$2            # 9 cycles from $2 load         \n\
+       xor $24,$25,$25         # 5 cycles from $25 load        \n\
+       stq $2,0($17)                                           \n\
+       xor $4,$5,$5            # 6 cycles from $5 load         \n\
+                                                               \n\
+       stq $5,8($17)                                           \n\
+       xor $7,$20,$20          # 7 cycles from $20 load        \n\
+       stq $20,16($17)                                         \n\
+       xor $22,$23,$23         # 7 cycles from $23 load        \n\
+                                                               \n\
+       stq $23,24($17)                                         \n\
+       xor $25,$27,$27         # 7 cycles from $27 load        \n\
+       stq $27,32($17)                                         \n\
+       nop                                                     \n\
+                                                               \n\
+       ldq $0,40($17)                                          \n\
+       ldq $1,40($18)                                          \n\
+       ldq $3,48($17)                                          \n\
+       ldq $4,48($18)                                          \n\
+                                                               \n\
+       ldq $6,56($17)                                          \n\
+       ldq $7,56($18)                                          \n\
+       ldq $2,40($19)                                          \n\
+       ldq $5,48($19)                                          \n\
+                                                               \n\
+       ldq $20,56($19)                                         \n\
+       xor $0,$1,$1            # 4 cycles from $1 load         \n\
+       xor $3,$4,$4            # 5 cycles from $4 load         \n\
+       xor $6,$7,$7            # 5 cycles from $7 load         \n\
+                                                               \n\
+       xor $1,$2,$2            # 4 cycles from $2 load         \n\
+       xor $4,$5,$5            # 5 cycles from $5 load         \n\
+       stq $2,40($17)                                          \n\
+       xor $7,$20,$20          # 4 cycles from $20 load        \n\
+                                                               \n\
+       stq $5,48($17)                                          \n\
+       subq $16,1,$16                                          \n\
+       stq $20,56($17)                                         \n\
+       addq $19,64,$19                                         \n\
+                                                               \n\
+       addq $18,64,$18                                         \n\
+       addq $17,64,$17                                         \n\
+       bgt $16,3b                                              \n\
+       ret                                                     \n\
+       .end xor_alpha_3                                        \n\
+                                                               \n\
+       .align 3                                                \n\
+       .ent xor_alpha_4                                        \n\
+xor_alpha_4:                                                   \n\
+       .prologue 0                                             \n\
+       srl $16, 6, $16                                         \n\
+       .align 4                                                \n\
+4:                                                             \n\
+       ldq $0,0($17)                                           \n\
+       ldq $1,0($18)                                           \n\
+       ldq $2,0($19)                                           \n\
+       ldq $3,0($20)                                           \n\
+                                                               \n\
+       ldq $4,8($17)                                           \n\
+       ldq $5,8($18)                                           \n\
+       ldq $6,8($19)                                           \n\
+       ldq $7,8($20)                                           \n\
+                                                               \n\
+       ldq $21,16($17)                                         \n\
+       ldq $22,16($18)                                         \n\
+       ldq $23,16($19)                                         \n\
+       ldq $24,16($20)                                         \n\
+                                                               \n\
+       ldq $25,24($17)                                         \n\
+       xor $0,$1,$1            # 6 cycles from $1 load         \n\
+       ldq $27,24($18)                                         \n\
+       xor $2,$3,$3            # 6 cycles from $3 load         \n\
+                                                               \n\
+       ldq $0,24($19)                                          \n\
+       xor $1,$3,$3                                            \n\
+       ldq $1,24($20)                                          \n\
+       xor $4,$5,$5            # 7 cycles from $5 load         \n\
+                                                               \n\
+       stq $3,0($17)                                           \n\
+       xor $6,$7,$7                                            \n\
+       xor $21,$22,$22         # 7 cycles from $22 load        \n\
+       xor $5,$7,$7                                            \n\
+                                                               \n\
+       stq $7,8($17)                                           \n\
+       xor $23,$24,$24         # 7 cycles from $24 load        \n\
+       ldq $2,32($17)                                          \n\
+       xor $22,$24,$24                                         \n\
+                                                               \n\
+       ldq $3,32($18)                                          \n\
+       ldq $4,32($19)                                          \n\
+       ldq $5,32($20)                                          \n\
+       xor $25,$27,$27         # 8 cycles from $27 load        \n\
+                                                               \n\
+       ldq $6,40($17)                                          \n\
+       ldq $7,40($18)                                          \n\
+       ldq $21,40($19)                                         \n\
+       ldq $22,40($20)                                         \n\
+                                                               \n\
+       stq $24,16($17)                                         \n\
+       xor $0,$1,$1            # 9 cycles from $1 load         \n\
+       xor $2,$3,$3            # 5 cycles from $3 load         \n\
+       xor $27,$1,$1                                           \n\
+                                                               \n\
+       stq $1,24($17)                                          \n\
+       xor $4,$5,$5            # 5 cycles from $5 load         \n\
+       ldq $23,48($17)                                         \n\
+       ldq $24,48($18)                                         \n\
+                                                               \n\
+       ldq $25,48($19)                                         \n\
+       xor $3,$5,$5                                            \n\
+       ldq $27,48($20)                                         \n\
+       ldq $0,56($17)                                          \n\
+                                                               \n\
+       ldq $1,56($18)                                          \n\
+       ldq $2,56($19)                                          \n\
+       xor $6,$7,$7            # 8 cycles from $6 load         \n\
+       ldq $3,56($20)                                          \n\
+                                                               \n\
+       stq $5,32($17)                                          \n\
+       xor $21,$22,$22         # 8 cycles from $22 load        \n\
+       xor $7,$22,$22                                          \n\
+       xor $23,$24,$24         # 5 cycles from $24 load        \n\
+                                                               \n\
+       stq $22,40($17)                                         \n\
+       xor $25,$27,$27         # 5 cycles from $27 load        \n\
+       xor $24,$27,$27                                         \n\
+       xor $0,$1,$1            # 5 cycles from $1 load         \n\
+                                                               \n\
+       stq $27,48($17)                                         \n\
+       xor $2,$3,$3            # 4 cycles from $3 load         \n\
+       xor $1,$3,$3                                            \n\
+       subq $16,1,$16                                          \n\
+                                                               \n\
+       stq $3,56($17)                                          \n\
+       addq $20,64,$20                                         \n\
+       addq $19,64,$19                                         \n\
+       addq $18,64,$18                                         \n\
+                                                               \n\
+       addq $17,64,$17                                         \n\
+       bgt $16,4b                                              \n\
+       ret                                                     \n\
+       .end xor_alpha_4                                        \n\
+                                                               \n\
+       .align 3                                                \n\
+       .ent xor_alpha_5                                        \n\
+xor_alpha_5:                                                   \n\
+       .prologue 0                                             \n\
+       srl $16, 6, $16                                         \n\
+       .align 4                                                \n\
+5:                                                             \n\
+       ldq $0,0($17)                                           \n\
+       ldq $1,0($18)                                           \n\
+       ldq $2,0($19)                                           \n\
+       ldq $3,0($20)                                           \n\
+                                                               \n\
+       ldq $4,0($21)                                           \n\
+       ldq $5,8($17)                                           \n\
+       ldq $6,8($18)                                           \n\
+       ldq $7,8($19)                                           \n\
+                                                               \n\
+       ldq $22,8($20)                                          \n\
+       ldq $23,8($21)                                          \n\
+       ldq $24,16($17)                                         \n\
+       ldq $25,16($18)                                         \n\
+                                                               \n\
+       ldq $27,16($19)                                         \n\
+       xor $0,$1,$1            # 6 cycles from $1 load         \n\
+       ldq $28,16($20)                                         \n\
+       xor $2,$3,$3            # 6 cycles from $3 load         \n\
+                                                               \n\
+       ldq $0,16($21)                                          \n\
+       xor $1,$3,$3                                            \n\
+       ldq $1,24($17)                                          \n\
+       xor $3,$4,$4            # 7 cycles from $4 load         \n\
+                                                               \n\
+       stq $4,0($17)                                           \n\
+       xor $5,$6,$6            # 7 cycles from $6 load         \n\
+       xor $7,$22,$22          # 7 cycles from $22 load        \n\
+       xor $6,$23,$23          # 7 cycles from $23 load        \n\
+                                                               \n\
+       ldq $2,24($18)                                          \n\
+       xor $22,$23,$23                                         \n\
+       ldq $3,24($19)                                          \n\
+       xor $24,$25,$25         # 8 cycles from $25 load        \n\
+                                                               \n\
+       stq $23,8($17)                                          \n\
+       xor $25,$27,$27         # 8 cycles from $27 load        \n\
+       ldq $4,24($20)                                          \n\
+       xor $28,$0,$0           # 7 cycles from $0 load         \n\
+                                                               \n\
+       ldq $5,24($21)                                          \n\
+       xor $27,$0,$0                                           \n\
+       ldq $6,32($17)                                          \n\
+       ldq $7,32($18)                                          \n\
+                                                               \n\
+       stq $0,16($17)                                          \n\
+       xor $1,$2,$2            # 6 cycles from $2 load         \n\
+       ldq $22,32($19)                                         \n\
+       xor $3,$4,$4            # 4 cycles from $4 load         \n\
+                                                               \n\
+       ldq $23,32($20)                                         \n\
+       xor $2,$4,$4                                            \n\
+       ldq $24,32($21)                                         \n\
+       ldq $25,40($17)                                         \n\
+                                                               \n\
+       ldq $27,40($18)                                         \n\
+       ldq $28,40($19)                                         \n\
+       ldq $0,40($20)                                          \n\
+       xor $4,$5,$5            # 7 cycles from $5 load         \n\
+                                                               \n\
+       stq $5,24($17)                                          \n\
+       xor $6,$7,$7            # 7 cycles from $7 load         \n\
+       ldq $1,40($21)                                          \n\
+       ldq $2,48($17)                                          \n\
+                                                               \n\
+       ldq $3,48($18)                                          \n\
+       xor $7,$22,$22          # 7 cycles from $22 load        \n\
+       ldq $4,48($19)                                          \n\
+       xor $23,$24,$24         # 6 cycles from $24 load        \n\
+                                                               \n\
+       ldq $5,48($20)                                          \n\
+       xor $22,$24,$24                                         \n\
+       ldq $6,48($21)                                          \n\
+       xor $25,$27,$27         # 7 cycles from $27 load        \n\
+                                                               \n\
+       stq $24,32($17)                                         \n\
+       xor $27,$28,$28         # 8 cycles from $28 load        \n\
+       ldq $7,56($17)                                          \n\
+       xor $0,$1,$1            # 6 cycles from $1 load         \n\
+                                                               \n\
+       ldq $22,56($18)                                         \n\
+       ldq $23,56($19)                                         \n\
+       ldq $24,56($20)                                         \n\
+       ldq $25,56($21)                                         \n\
+                                                               \n\
+       xor $28,$1,$1                                           \n\
+       xor $2,$3,$3            # 9 cycles from $3 load         \n\
+       xor $3,$4,$4            # 9 cycles from $4 load         \n\
+       xor $5,$6,$6            # 8 cycles from $6 load         \n\
+                                                               \n\
+       stq $1,40($17)                                          \n\
+       xor $4,$6,$6                                            \n\
+       xor $7,$22,$22          # 7 cycles from $22 load        \n\
+       xor $23,$24,$24         # 6 cycles from $24 load        \n\
+                                                               \n\
+       stq $6,48($17)                                          \n\
+       xor $22,$24,$24                                         \n\
+       subq $16,1,$16                                          \n\
+       xor $24,$25,$25         # 8 cycles from $25 load        \n\
+                                                               \n\
+       stq $25,56($17)                                         \n\
+       addq $21,64,$21                                         \n\
+       addq $20,64,$20                                         \n\
+       addq $19,64,$19                                         \n\
+                                                               \n\
+       addq $18,64,$18                                         \n\
+       addq $17,64,$17                                         \n\
+       bgt $16,5b                                              \n\
+       ret                                                     \n\
+       .end xor_alpha_5                                        \n\
+                                                               \n\
+       .align 3                                                \n\
+       .ent xor_alpha_prefetch_2                               \n\
+xor_alpha_prefetch_2:                                          \n\
+       .prologue 0                                             \n\
+       srl $16, 6, $16                                         \n\
+                                                               \n\
+       ldq $31, 0($17)                                         \n\
+       ldq $31, 0($18)                                         \n\
+                                                               \n\
+       ldq $31, 64($17)                                        \n\
+       ldq $31, 64($18)                                        \n\
+                                                               \n\
+       ldq $31, 128($17)                                       \n\
+       ldq $31, 128($18)                                       \n\
+                                                               \n\
+       ldq $31, 192($17)                                       \n\
+       ldq $31, 192($18)                                       \n\
+       .align 4                                                \n\
+2:                                                             \n\
+       ldq $0,0($17)                                           \n\
+       ldq $1,0($18)                                           \n\
+       ldq $2,8($17)                                           \n\
+       ldq $3,8($18)                                           \n\
+                                                               \n\
+       ldq $4,16($17)                                          \n\
+       ldq $5,16($18)                                          \n\
+       ldq $6,24($17)                                          \n\
+       ldq $7,24($18)                                          \n\
+                                                               \n\
+       ldq $19,32($17)                                         \n\
+       ldq $20,32($18)                                         \n\
+       ldq $21,40($17)                                         \n\
+       ldq $22,40($18)                                         \n\
+                                                               \n\
+       ldq $23,48($17)                                         \n\
+       ldq $24,48($18)                                         \n\
+       ldq $25,56($17)                                         \n\
+       ldq $27,56($18)                                         \n\
+                                                               \n\
+       ldq $31,256($17)                                        \n\
+       xor $0,$1,$0            # 8 cycles from $1 load         \n\
+       ldq $31,256($18)                                        \n\
+       xor $2,$3,$2                                            \n\
+                                                               \n\
+       stq $0,0($17)                                           \n\
+       xor $4,$5,$4                                            \n\
+       stq $2,8($17)                                           \n\
+       xor $6,$7,$6                                            \n\
+                                                               \n\
+       stq $4,16($17)                                          \n\
+       xor $19,$20,$19                                         \n\
+       stq $6,24($17)                                          \n\
+       xor $21,$22,$21                                         \n\
+                                                               \n\
+       stq $19,32($17)                                         \n\
+       xor $23,$24,$23                                         \n\
+       stq $21,40($17)                                         \n\
+       xor $25,$27,$25                                         \n\
+                                                               \n\
+       stq $23,48($17)                                         \n\
+       subq $16,1,$16                                          \n\
+       stq $25,56($17)                                         \n\
+       addq $17,64,$17                                         \n\
+                                                               \n\
+       addq $18,64,$18                                         \n\
+       bgt $16,2b                                              \n\
+       ret                                                     \n\
+       .end xor_alpha_prefetch_2                               \n\
+                                                               \n\
+       .align 3                                                \n\
+       .ent xor_alpha_prefetch_3                               \n\
+xor_alpha_prefetch_3:                                          \n\
+       .prologue 0                                             \n\
+       srl $16, 6, $16                                         \n\
+                                                               \n\
+       ldq $31, 0($17)                                         \n\
+       ldq $31, 0($18)                                         \n\
+       ldq $31, 0($19)                                         \n\
+                                                               \n\
+       ldq $31, 64($17)                                        \n\
+       ldq $31, 64($18)                                        \n\
+       ldq $31, 64($19)                                        \n\
+                                                               \n\
+       ldq $31, 128($17)                                       \n\
+       ldq $31, 128($18)                                       \n\
+       ldq $31, 128($19)                                       \n\
+                                                               \n\
+       ldq $31, 192($17)                                       \n\
+       ldq $31, 192($18)                                       \n\
+       ldq $31, 192($19)                                       \n\
+       .align 4                                                \n\
+3:                                                             \n\
+       ldq $0,0($17)                                           \n\
+       ldq $1,0($18)                                           \n\
+       ldq $2,0($19)                                           \n\
+       ldq $3,8($17)                                           \n\
+                                                               \n\
+       ldq $4,8($18)                                           \n\
+       ldq $6,16($17)                                          \n\
+       ldq $7,16($18)                                          \n\
+       ldq $21,24($17)                                         \n\
+                                                               \n\
+       ldq $22,24($18)                                         \n\
+       ldq $24,32($17)                                         \n\
+       ldq $25,32($18)                                         \n\
+       ldq $5,8($19)                                           \n\
+                                                               \n\
+       ldq $20,16($19)                                         \n\
+       ldq $23,24($19)                                         \n\
+       ldq $27,32($19)                                         \n\
+       nop                                                     \n\
+                                                               \n\
+       xor $0,$1,$1            # 8 cycles from $0 load         \n\
+       xor $3,$4,$4            # 7 cycles from $4 load         \n\
+       xor $6,$7,$7            # 6 cycles from $7 load         \n\
+       xor $21,$22,$22         # 5 cycles from $22 load        \n\
+                                                               \n\
+       xor $1,$2,$2            # 9 cycles from $2 load         \n\
+       xor $24,$25,$25         # 5 cycles from $25 load        \n\
+       stq $2,0($17)                                           \n\
+       xor $4,$5,$5            # 6 cycles from $5 load         \n\
+                                                               \n\
+       stq $5,8($17)                                           \n\
+       xor $7,$20,$20          # 7 cycles from $20 load        \n\
+       stq $20,16($17)                                         \n\
+       xor $22,$23,$23         # 7 cycles from $23 load        \n\
+                                                               \n\
+       stq $23,24($17)                                         \n\
+       xor $25,$27,$27         # 7 cycles from $27 load        \n\
+       stq $27,32($17)                                         \n\
+       nop                                                     \n\
+                                                               \n\
+       ldq $0,40($17)                                          \n\
+       ldq $1,40($18)                                          \n\
+       ldq $3,48($17)                                          \n\
+       ldq $4,48($18)                                          \n\
+                                                               \n\
+       ldq $6,56($17)                                          \n\
+       ldq $7,56($18)                                          \n\
+       ldq $2,40($19)                                          \n\
+       ldq $5,48($19)                                          \n\
+                                                               \n\
+       ldq $20,56($19)                                         \n\
+       ldq $31,256($17)                                        \n\
+       ldq $31,256($18)                                        \n\
+       ldq $31,256($19)                                        \n\
+                                                               \n\
+       xor $0,$1,$1            # 6 cycles from $1 load         \n\
+       xor $3,$4,$4            # 5 cycles from $4 load         \n\
+       xor $6,$7,$7            # 5 cycles from $7 load         \n\
+       xor $1,$2,$2            # 4 cycles from $2 load         \n\
+                                                               \n\
+       xor $4,$5,$5            # 5 cycles from $5 load         \n\
+       xor $7,$20,$20          # 4 cycles from $20 load        \n\
+       stq $2,40($17)                                          \n\
+       subq $16,1,$16                                          \n\
+                                                               \n\
+       stq $5,48($17)                                          \n\
+       addq $19,64,$19                                         \n\
+       stq $20,56($17)                                         \n\
+       addq $18,64,$18                                         \n\
+                                                               \n\
+       addq $17,64,$17                                         \n\
+       bgt $16,3b                                              \n\
+       ret                                                     \n\
+       .end xor_alpha_prefetch_3                               \n\
+                                                               \n\
+       .align 3                                                \n\
+       .ent xor_alpha_prefetch_4                               \n\
+xor_alpha_prefetch_4:                                          \n\
+       .prologue 0                                             \n\
+       srl $16, 6, $16                                         \n\
+                                                               \n\
+       ldq $31, 0($17)                                         \n\
+       ldq $31, 0($18)                                         \n\
+       ldq $31, 0($19)                                         \n\
+       ldq $31, 0($20)                                         \n\
+                                                               \n\
+       ldq $31, 64($17)                                        \n\
+       ldq $31, 64($18)                                        \n\
+       ldq $31, 64($19)                                        \n\
+       ldq $31, 64($20)                                        \n\
+                                                               \n\
+       ldq $31, 128($17)                                       \n\
+       ldq $31, 128($18)                                       \n\
+       ldq $31, 128($19)                                       \n\
+       ldq $31, 128($20)                                       \n\
+                                                               \n\
+       ldq $31, 192($17)                                       \n\
+       ldq $31, 192($18)                                       \n\
+       ldq $31, 192($19)                                       \n\
+       ldq $31, 192($20)                                       \n\
+       .align 4                                                \n\
+4:                                                             \n\
+       ldq $0,0($17)                                           \n\
+       ldq $1,0($18)                                           \n\
+       ldq $2,0($19)                                           \n\
+       ldq $3,0($20)                                           \n\
+                                                               \n\
+       ldq $4,8($17)                                           \n\
+       ldq $5,8($18)                                           \n\
+       ldq $6,8($19)                                           \n\
+       ldq $7,8($20)                                           \n\
+                                                               \n\
+       ldq $21,16($17)                                         \n\
+       ldq $22,16($18)                                         \n\
+       ldq $23,16($19)                                         \n\
+       ldq $24,16($20)                                         \n\
+                                                               \n\
+       ldq $25,24($17)                                         \n\
+       xor $0,$1,$1            # 6 cycles from $1 load         \n\
+       ldq $27,24($18)                                         \n\
+       xor $2,$3,$3            # 6 cycles from $3 load         \n\
+                                                               \n\
+       ldq $0,24($19)                                          \n\
+       xor $1,$3,$3                                            \n\
+       ldq $1,24($20)                                          \n\
+       xor $4,$5,$5            # 7 cycles from $5 load         \n\
+                                                               \n\
+       stq $3,0($17)                                           \n\
+       xor $6,$7,$7                                            \n\
+       xor $21,$22,$22         # 7 cycles from $22 load        \n\
+       xor $5,$7,$7                                            \n\
+                                                               \n\
+       stq $7,8($17)                                           \n\
+       xor $23,$24,$24         # 7 cycles from $24 load        \n\
+       ldq $2,32($17)                                          \n\
+       xor $22,$24,$24                                         \n\
+                                                               \n\
+       ldq $3,32($18)                                          \n\
+       ldq $4,32($19)                                          \n\
+       ldq $5,32($20)                                          \n\
+       xor $25,$27,$27         # 8 cycles from $27 load        \n\
+                                                               \n\
+       ldq $6,40($17)                                          \n\
+       ldq $7,40($18)                                          \n\
+       ldq $21,40($19)                                         \n\
+       ldq $22,40($20)                                         \n\
+                                                               \n\
+       stq $24,16($17)                                         \n\
+       xor $0,$1,$1            # 9 cycles from $1 load         \n\
+       xor $2,$3,$3            # 5 cycles from $3 load         \n\
+       xor $27,$1,$1                                           \n\
+                                                               \n\
+       stq $1,24($17)                                          \n\
+       xor $4,$5,$5            # 5 cycles from $5 load         \n\
+       ldq $23,48($17)                                         \n\
+       xor $3,$5,$5                                            \n\
+                                                               \n\
+       ldq $24,48($18)                                         \n\
+       ldq $25,48($19)                                         \n\
+       ldq $27,48($20)                                         \n\
+       ldq $0,56($17)                                          \n\
+                                                               \n\
+       ldq $1,56($18)                                          \n\
+       ldq $2,56($19)                                          \n\
+       ldq $3,56($20)                                          \n\
+       xor $6,$7,$7            # 8 cycles from $6 load         \n\
+                                                               \n\
+       ldq $31,256($17)                                        \n\
+       xor $21,$22,$22         # 8 cycles from $22 load        \n\
+       ldq $31,256($18)                                        \n\
+       xor $7,$22,$22                                          \n\
+                                                               \n\
+       ldq $31,256($19)                                        \n\
+       xor $23,$24,$24         # 6 cycles from $24 load        \n\
+       ldq $31,256($20)                                        \n\
+       xor $25,$27,$27         # 6 cycles from $27 load        \n\
+                                                               \n\
+       stq $5,32($17)                                          \n\
+       xor $24,$27,$27                                         \n\
+       xor $0,$1,$1            # 7 cycles from $1 load         \n\
+       xor $2,$3,$3            # 6 cycles from $3 load         \n\
+                                                               \n\
+       stq $22,40($17)                                         \n\
+       xor $1,$3,$3                                            \n\
+       stq $27,48($17)                                         \n\
+       subq $16,1,$16                                          \n\
+                                                               \n\
+       stq $3,56($17)                                          \n\
+       addq $20,64,$20                                         \n\
+       addq $19,64,$19                                         \n\
+       addq $18,64,$18                                         \n\
+                                                               \n\
+       addq $17,64,$17                                         \n\
+       bgt $16,4b                                              \n\
+       ret                                                     \n\
+       .end xor_alpha_prefetch_4                               \n\
+                                                               \n\
+       .align 3                                                \n\
+       .ent xor_alpha_prefetch_5                               \n\
+xor_alpha_prefetch_5:                                          \n\
+       .prologue 0                                             \n\
+       srl $16, 6, $16                                         \n\
+                                                               \n\
+       ldq $31, 0($17)                                         \n\
+       ldq $31, 0($18)                                         \n\
+       ldq $31, 0($19)                                         \n\
+       ldq $31, 0($20)                                         \n\
+       ldq $31, 0($21)                                         \n\
+                                                               \n\
+       ldq $31, 64($17)                                        \n\
+       ldq $31, 64($18)                                        \n\
+       ldq $31, 64($19)                                        \n\
+       ldq $31, 64($20)                                        \n\
+       ldq $31, 64($21)                                        \n\
+                                                               \n\
+       ldq $31, 128($17)                                       \n\
+       ldq $31, 128($18)                                       \n\
+       ldq $31, 128($19)                                       \n\
+       ldq $31, 128($20)                                       \n\
+       ldq $31, 128($21)                                       \n\
+                                                               \n\
+       ldq $31, 192($17)                                       \n\
+       ldq $31, 192($18)                                       \n\
+       ldq $31, 192($19)                                       \n\
+       ldq $31, 192($20)                                       \n\
+       ldq $31, 192($21)                                       \n\
+       .align 4                                                \n\
+5:                                                             \n\
+       ldq $0,0($17)                                           \n\
+       ldq $1,0($18)                                           \n\
+       ldq $2,0($19)                                           \n\
+       ldq $3,0($20)                                           \n\
+                                                               \n\
+       ldq $4,0($21)                                           \n\
+       ldq $5,8($17)                                           \n\
+       ldq $6,8($18)                                           \n\
+       ldq $7,8($19)                                           \n\
+                                                               \n\
+       ldq $22,8($20)                                          \n\
+       ldq $23,8($21)                                          \n\
+       ldq $24,16($17)                                         \n\
+       ldq $25,16($18)                                         \n\
+                                                               \n\
+       ldq $27,16($19)                                         \n\
+       xor $0,$1,$1            # 6 cycles from $1 load         \n\
+       ldq $28,16($20)                                         \n\
+       xor $2,$3,$3            # 6 cycles from $3 load         \n\
+                                                               \n\
+       ldq $0,16($21)                                          \n\
+       xor $1,$3,$3                                            \n\
+       ldq $1,24($17)                                          \n\
+       xor $3,$4,$4            # 7 cycles from $4 load         \n\
+                                                               \n\
+       stq $4,0($17)                                           \n\
+       xor $5,$6,$6            # 7 cycles from $6 load         \n\
+       xor $7,$22,$22          # 7 cycles from $22 load        \n\
+       xor $6,$23,$23          # 7 cycles from $23 load        \n\
+                                                               \n\
+       ldq $2,24($18)                                          \n\
+       xor $22,$23,$23                                         \n\
+       ldq $3,24($19)                                          \n\
+       xor $24,$25,$25         # 8 cycles from $25 load        \n\
+                                                               \n\
+       stq $23,8($17)                                          \n\
+       xor $25,$27,$27         # 8 cycles from $27 load        \n\
+       ldq $4,24($20)                                          \n\
+       xor $28,$0,$0           # 7 cycles from $0 load         \n\
+                                                               \n\
+       ldq $5,24($21)                                          \n\
+       xor $27,$0,$0                                           \n\
+       ldq $6,32($17)                                          \n\
+       ldq $7,32($18)                                          \n\
+                                                               \n\
+       stq $0,16($17)                                          \n\
+       xor $1,$2,$2            # 6 cycles from $2 load         \n\
+       ldq $22,32($19)                                         \n\
+       xor $3,$4,$4            # 4 cycles from $4 load         \n\
+                                                               \n\
+       ldq $23,32($20)                                         \n\
+       xor $2,$4,$4                                            \n\
+       ldq $24,32($21)                                         \n\
+       ldq $25,40($17)                                         \n\
+                                                               \n\
+       ldq $27,40($18)                                         \n\
+       ldq $28,40($19)                                         \n\
+       ldq $0,40($20)                                          \n\
+       xor $4,$5,$5            # 7 cycles from $5 load         \n\
+                                                               \n\
+       stq $5,24($17)                                          \n\
+       xor $6,$7,$7            # 7 cycles from $7 load         \n\
+       ldq $1,40($21)                                          \n\
+       ldq $2,48($17)                                          \n\
+                                                               \n\
+       ldq $3,48($18)                                          \n\
+       xor $7,$22,$22          # 7 cycles from $22 load        \n\
+       ldq $4,48($19)                                          \n\
+       xor $23,$24,$24         # 6 cycles from $24 load        \n\
+                                                               \n\
+       ldq $5,48($20)                                          \n\
+       xor $22,$24,$24                                         \n\
+       ldq $6,48($21)                                          \n\
+       xor $25,$27,$27         # 7 cycles from $27 load        \n\
+                                                               \n\
+       stq $24,32($17)                                         \n\
+       xor $27,$28,$28         # 8 cycles from $28 load        \n\
+       ldq $7,56($17)                                          \n\
+       xor $0,$1,$1            # 6 cycles from $1 load         \n\
+                                                               \n\
+       ldq $22,56($18)                                         \n\
+       ldq $23,56($19)                                         \n\
+       ldq $24,56($20)                                         \n\
+       ldq $25,56($21)                                         \n\
+                                                               \n\
+       ldq $31,256($17)                                        \n\
+       xor $28,$1,$1                                           \n\
+       ldq $31,256($18)                                        \n\
+       xor $2,$3,$3            # 9 cycles from $3 load         \n\
+                                                               \n\
+       ldq $31,256($19)                                        \n\
+       xor $3,$4,$4            # 9 cycles from $4 load         \n\
+       ldq $31,256($20)                                        \n\
+       xor $5,$6,$6            # 8 cycles from $6 load         \n\
+                                                               \n\
+       stq $1,40($17)                                          \n\
+       xor $4,$6,$6                                            \n\
+       xor $7,$22,$22          # 7 cycles from $22 load        \n\
+       xor $23,$24,$24         # 6 cycles from $24 load        \n\
+                                                               \n\
+       stq $6,48($17)                                          \n\
+       xor $22,$24,$24                                         \n\
+       ldq $31,256($21)                                        \n\
+       xor $24,$25,$25         # 8 cycles from $25 load        \n\
+                                                               \n\
+       stq $25,56($17)                                         \n\
+       subq $16,1,$16                                          \n\
+       addq $21,64,$21                                         \n\
+       addq $20,64,$20                                         \n\
+                                                               \n\
+       addq $19,64,$19                                         \n\
+       addq $18,64,$18                                         \n\
+       addq $17,64,$17                                         \n\
+       bgt $16,5b                                              \n\
+                                                               \n\
+       ret                                                     \n\
+       .end xor_alpha_prefetch_5                               \n\
+");
+
+static struct xor_block_template xor_block_alpha = {
+       .name   = "alpha",
+       .do_2   = xor_alpha_2,
+       .do_3   = xor_alpha_3,
+       .do_4   = xor_alpha_4,
+       .do_5   = xor_alpha_5,
+};
+
+static struct xor_block_template xor_block_alpha_prefetch = {
+       .name   = "alpha prefetch",
+       .do_2   = xor_alpha_prefetch_2,
+       .do_3   = xor_alpha_prefetch_3,
+       .do_4   = xor_alpha_prefetch_4,
+       .do_5   = xor_alpha_prefetch_5,
+};
+
+/* For grins, also test the generic routines.  */
+#include <asm-generic/xor.h>
+
+#undef XOR_TRY_TEMPLATES
+#define XOR_TRY_TEMPLATES                              \
+       do {                                            \
+               xor_speed(&xor_block_8regs);            \
+               xor_speed(&xor_block_32regs);           \
+               xor_speed(&xor_block_alpha);            \
+               xor_speed(&xor_block_alpha_prefetch);   \
+       } while (0)
+
+/* Force the use of alpha_prefetch if EV6, as it is significantly
+   faster in the cold cache case.  */
+#define XOR_SELECT_TEMPLATE(FASTEST) \
+       (implver() == IMPLVER_EV6 ? &xor_block_alpha_prefetch : FASTEST)
index 69130f3..aecc6c3 100644 (file)
@@ -246,9 +246,9 @@ map_single(struct device *dev, void *ptr, size_t size,
                }
 
                dev_dbg(dev,
-                       "%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n",
-                       __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr),
-                       buf->safe, (void *) buf->safe_dma_addr);
+                       "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n",
+                       __func__, buf->ptr, virt_to_dma(dev, buf->ptr),
+                       buf->safe, buf->safe_dma_addr);
 
                if ((dir == DMA_TO_DEVICE) ||
                    (dir == DMA_BIDIRECTIONAL)) {
@@ -292,9 +292,9 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
                BUG_ON(buf->size != size);
 
                dev_dbg(dev,
-                       "%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n",
-                       __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr),
-                       buf->safe, (void *) buf->safe_dma_addr);
+                       "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n",
+                       __func__, buf->ptr, virt_to_dma(dev, buf->ptr),
+                       buf->safe, buf->safe_dma_addr);
 
                DO_STATS ( device_info->bounce_count++ );
 
@@ -321,9 +321,8 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
        }
 }
 
-static inline void
-sync_single(struct device *dev, dma_addr_t dma_addr, size_t size,
-               enum dma_data_direction dir)
+static int sync_single(struct device *dev, dma_addr_t dma_addr, size_t size,
+                       enum dma_data_direction dir)
 {
        struct dmabounce_device_info *device_info = dev->archdata.dmabounce;
        struct safe_buffer *buf = NULL;
@@ -355,9 +354,9 @@ sync_single(struct device *dev, dma_addr_t dma_addr, size_t size,
                 */
 
                dev_dbg(dev,
-                       "%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n",
-                       __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr),
-                       buf->safe, (void *) buf->safe_dma_addr);
+                       "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n",
+                       __func__, buf->ptr, virt_to_dma(dev, buf->ptr),
+                       buf->safe, buf->safe_dma_addr);
 
                DO_STATS ( device_info->bounce_count++ );
 
@@ -383,8 +382,9 @@ sync_single(struct device *dev, dma_addr_t dma_addr, size_t size,
                 * No need to sync the safe buffer - it was allocated
                 * via the coherent allocators.
                 */
+               return 0;
        } else {
-               dma_cache_maint(dma_to_virt(dev, dma_addr), size, dir);
+               return 1;
        }
 }
 
@@ -474,25 +474,29 @@ dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
        }
 }
 
-void
-dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_addr, size_t size,
-                               enum dma_data_direction dir)
+void dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_addr,
+                                  unsigned long offset, size_t size,
+                                  enum dma_data_direction dir)
 {
-       dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n",
-               __func__, (void *) dma_addr, size, dir);
+       dev_dbg(dev, "%s(dma=%#x,off=%#lx,size=%zx,dir=%x)\n",
+               __func__, dma_addr, offset, size, dir);
 
-       sync_single(dev, dma_addr, size, dir);
+       if (sync_single(dev, dma_addr, offset + size, dir))
+               dma_cache_maint(dma_to_virt(dev, dma_addr) + offset, size, dir);
 }
+EXPORT_SYMBOL(dma_sync_single_range_for_cpu);
 
-void
-dma_sync_single_for_device(struct device *dev, dma_addr_t dma_addr, size_t size,
-                               enum dma_data_direction dir)
+void dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_addr,
+                                     unsigned long offset, size_t size,
+                                     enum dma_data_direction dir)
 {
-       dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n",
-               __func__, (void *) dma_addr, size, dir);
+       dev_dbg(dev, "%s(dma=%#x,off=%#lx,size=%zx,dir=%x)\n",
+               __func__, dma_addr, offset, size, dir);
 
-       sync_single(dev, dma_addr, size, dir);
+       if (sync_single(dev, dma_addr, offset + size, dir))
+               dma_cache_maint(dma_to_virt(dev, dma_addr) + offset, size, dir);
 }
+EXPORT_SYMBOL(dma_sync_single_range_for_device);
 
 void
 dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents,
@@ -644,8 +648,6 @@ EXPORT_SYMBOL(dma_map_single);
 EXPORT_SYMBOL(dma_unmap_single);
 EXPORT_SYMBOL(dma_map_sg);
 EXPORT_SYMBOL(dma_unmap_sg);
-EXPORT_SYMBOL(dma_sync_single_for_cpu);
-EXPORT_SYMBOL(dma_sync_single_for_device);
 EXPORT_SYMBOL(dma_sync_sg_for_cpu);
 EXPORT_SYMBOL(dma_sync_sg_for_device);
 EXPORT_SYMBOL(dmabounce_register_dev);
index 9578b5d..1464ffe 100644 (file)
@@ -757,7 +757,14 @@ CONFIG_INPUT_EVDEV=y
 #
 # Input Device Drivers
 #
-# CONFIG_INPUT_KEYBOARD is not set
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+CONFIG_KEYBOARD_GPIO=y
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TABLET is not set
@@ -1111,11 +1118,11 @@ CONFIG_RTC_DRV_DS1307=y
 CONFIG_RTC_DRV_RS5C372=y
 # CONFIG_RTC_DRV_ISL1208 is not set
 # CONFIG_RTC_DRV_X1205 is not set
-# CONFIG_RTC_DRV_PCF8563 is not set
+CONFIG_RTC_DRV_PCF8563=y
 # CONFIG_RTC_DRV_PCF8583 is not set
 CONFIG_RTC_DRV_M41T80=y
 # CONFIG_RTC_DRV_M41T80_WDT is not set
-# CONFIG_RTC_DRV_S35390A is not set
+CONFIG_RTC_DRV_S35390A=y
 
 #
 # SPI RTC drivers
index 45329fc..7b95d20 100644 (file)
@@ -3,11 +3,48 @@
 
 #ifdef __KERNEL__
 
-#include <linux/mm.h> /* need struct page */
-
+#include <linux/mm_types.h>
 #include <linux/scatterlist.h>
 
 #include <asm-generic/dma-coherent.h>
+#include <asm/memory.h>
+
+/*
+ * page_to_dma/dma_to_virt/virt_to_dma are architecture private functions
+ * used internally by the DMA-mapping API to provide DMA addresses. They
+ * must not be used by drivers.
+ */
+#ifndef __arch_page_to_dma
+static inline dma_addr_t page_to_dma(struct device *dev, struct page *page)
+{
+       return (dma_addr_t)__virt_to_bus((unsigned long)page_address(page));
+}
+
+static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
+{
+       return (void *)__bus_to_virt(addr);
+}
+
+static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
+{
+       return (dma_addr_t)__virt_to_bus((unsigned long)(addr));
+}
+#else
+static inline dma_addr_t page_to_dma(struct device *dev, struct page *page)
+{
+       return __arch_page_to_dma(dev, page);
+}
+
+static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
+{
+       return __arch_dma_to_virt(dev, addr);
+}
+
+static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
+{
+       return __arch_virt_to_dma(dev, addr);
+}
+#endif
 
 /*
  * DMA-consistent mapping functions.  These allocate/free a region of
@@ -169,7 +206,7 @@ dma_map_single(struct device *dev, void *cpu_addr, size_t size,
        if (!arch_is_coherent())
                dma_cache_maint(cpu_addr, size, dir);
 
-       return virt_to_dma(dev, (unsigned long)cpu_addr);
+       return virt_to_dma(dev, cpu_addr);
 }
 #else
 extern dma_addr_t dma_map_single(struct device *,void *, size_t, enum dma_data_direction);
@@ -195,7 +232,7 @@ dma_map_page(struct device *dev, struct page *page,
             unsigned long offset, size_t size,
             enum dma_data_direction dir)
 {
-       return dma_map_single(dev, page_address(page) + offset, size, (int)dir);
+       return dma_map_single(dev, page_address(page) + offset, size, dir);
 }
 
 /**
@@ -241,7 +278,7 @@ static inline void
 dma_unmap_page(struct device *dev, dma_addr_t handle, size_t size,
               enum dma_data_direction dir)
 {
-       dma_unmap_single(dev, handle, size, (int)dir);
+       dma_unmap_single(dev, handle, size, dir);
 }
 
 /**
@@ -314,11 +351,12 @@ extern void dma_unmap_sg(struct device *, struct scatterlist *, int, enum dma_da
 
 
 /**
- * dma_sync_single_for_cpu
+ * dma_sync_single_range_for_cpu
  * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
  * @handle: DMA address of buffer
- * @size: size of buffer to map
- * @dir: DMA transfer direction
+ * @offset: offset of region to start sync
+ * @size: size of region to sync
+ * @dir: DMA transfer direction (same as passed to dma_map_single)
  *
  * Make physical memory consistent for a single streaming mode DMA
  * translation after a transfer.
@@ -332,25 +370,41 @@ extern void dma_unmap_sg(struct device *, struct scatterlist *, int, enum dma_da
  */
 #ifndef CONFIG_DMABOUNCE
 static inline void
-dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size,
-                       enum dma_data_direction dir)
+dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t handle,
+                             unsigned long offset, size_t size,
+                             enum dma_data_direction dir)
 {
        if (!arch_is_coherent())
-               dma_cache_maint((void *)dma_to_virt(dev, handle), size, dir);
+               dma_cache_maint(dma_to_virt(dev, handle) + offset, size, dir);
 }
 
 static inline void
-dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size,
-                          enum dma_data_direction dir)
+dma_sync_single_range_for_device(struct device *dev, dma_addr_t handle,
+                                unsigned long offset, size_t size,
+                                enum dma_data_direction dir)
 {
        if (!arch_is_coherent())
-               dma_cache_maint((void *)dma_to_virt(dev, handle), size, dir);
+               dma_cache_maint(dma_to_virt(dev, handle) + offset, size, dir);
 }
 #else
-extern void dma_sync_single_for_cpu(struct device*, dma_addr_t, size_t, enum dma_data_direction);
-extern void dma_sync_single_for_device(struct device*, dma_addr_t, size_t, enum dma_data_direction);
+extern void dma_sync_single_range_for_cpu(struct device *, dma_addr_t, unsigned long, size_t, enum dma_data_direction);
+extern void dma_sync_single_range_for_device(struct device *, dma_addr_t, unsigned long, size_t, enum dma_data_direction);
 #endif
 
+static inline void
+dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size,
+                       enum dma_data_direction dir)
+{
+       dma_sync_single_range_for_cpu(dev, handle, 0, size, dir);
+}
+
+static inline void
+dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size,
+                          enum dma_data_direction dir)
+{
+       dma_sync_single_range_for_device(dev, handle, 0, size, dir);
+}
+
 
 /**
  * dma_sync_sg_for_cpu
index c8986bb..df15a0d 100644 (file)
@@ -10,7 +10,7 @@
 /* Maximum address we can use for the control code buffer */
 #define KEXEC_CONTROL_MEMORY_LIMIT (-1UL)
 
-#define KEXEC_CONTROL_CODE_SIZE        4096
+#define KEXEC_CONTROL_PAGE_SIZE        4096
 
 #define KEXEC_ARCH KEXEC_ARCH_ARM
 
index 1e070a2..bf7c737 100644 (file)
 #define arch_adjust_zones(node,size,holes) do { } while (0)
 #endif
 
+/*
+ * Amount of memory reserved for the vmalloc() area, and minimum
+ * address for vmalloc mappings.
+ */
+extern unsigned long vmalloc_reserve;
+
+#define VMALLOC_MIN            (void *)(VMALLOC_END - vmalloc_reserve)
+
 /*
  * PFNs are used to describe any physical page; this means
  * PFN 0 == physical address 0.
@@ -305,20 +313,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
  */
 #define page_to_phys(page)     (page_to_pfn(page) << PAGE_SHIFT)
 
-/*
- * Optional device DMA address remapping. Do _not_ use directly!
- * We should really eliminate virt_to_bus() here - it's deprecated.
- */
-#ifndef __arch_page_to_dma
-#define page_to_dma(dev, page)         ((dma_addr_t)__virt_to_bus((unsigned long)page_address(page)))
-#define dma_to_virt(dev, addr)         ((void *)__bus_to_virt(addr))
-#define virt_to_dma(dev, addr)         ((dma_addr_t)__virt_to_bus((unsigned long)(addr)))
-#else
-#define page_to_dma(dev, page)         (__arch_page_to_dma(dev, page))
-#define dma_to_virt(dev, addr)         (__arch_dma_to_virt(dev, addr))
-#define virt_to_dma(dev, addr)         (__arch_virt_to_dma(dev, addr))
-#endif
-
 /*
  * Optional coherency support.  Currently used only by selected
  * Intel XSC3-based systems.
index 4225372..d8fbe2d 100644 (file)
@@ -10,8 +10,6 @@
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
- *
- * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $
  */
 
 #ifndef __ARM_MTD_XIP_H__
index b01d5e7..517a4d6 100644 (file)
@@ -112,9 +112,9 @@ extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
 static inline void prefetch(const void *ptr)
 {
        __asm__ __volatile__(
-               "pld\t%0"
+               "pld\t%a0"
                :
-               : "o" (*(char *)ptr)
+               : "p" (ptr)
                : "cc");
 }
 
index 0d0d40f..b543a05 100644 (file)
@@ -54,6 +54,7 @@
  *       v4wbi - ARMv4 with write buffer with I TLB flush entry instruction
  *       fr    - Feroceon (v4wbi with non-outer-cacheable page table walks)
  *       v6wbi - ARMv6 with write buffer with I TLB flush entry instruction
+ *       v7wbi - identical to v6wbi
  */
 #undef _TLB
 #undef MULTI_TLB
@@ -266,14 +267,16 @@ extern struct cpu_tlb_fns cpu_tlb;
                                 v4wbi_possible_flags | \
                                 fr_possible_flags | \
                                 v4wb_possible_flags | \
-                                v6wbi_possible_flags)
+                                v6wbi_possible_flags | \
+                                v7wbi_possible_flags)
 
 #define always_tlb_flags       (v3_always_flags & \
                                 v4_always_flags & \
                                 v4wbi_always_flags & \
                                 fr_always_flags & \
                                 v4wb_always_flags & \
-                                v6wbi_always_flags)
+                                v6wbi_always_flags & \
+                                v7wbi_always_flags)
 
 #define tlb_flag(f)    ((always_tlb_flags & (f)) || (__tlb_flag & possible_tlb_flags & (f)))
 
index f95fbb2..0106184 100644 (file)
 #define __NR_fallocate                 (__NR_SYSCALL_BASE+352)
 #define __NR_timerfd_settime           (__NR_SYSCALL_BASE+353)
 #define __NR_timerfd_gettime           (__NR_SYSCALL_BASE+354)
+#define __NR_signalfd4                 (__NR_SYSCALL_BASE+355)
+#define __NR_eventfd2                  (__NR_SYSCALL_BASE+356)
+#define __NR_epoll_create1             (__NR_SYSCALL_BASE+357)
+#define __NR_dup3                      (__NR_SYSCALL_BASE+358)
+#define __NR_pipe2                     (__NR_SYSCALL_BASE+359)
+#define __NR_inotify_init1             (__NR_SYSCALL_BASE+360)
 
 /*
  * The following SWIs are ARM private.
diff --git a/arch/arm/kernel/.gitignore b/arch/arm/kernel/.gitignore
new file mode 100644 (file)
index 0000000..c5f676c
--- /dev/null
@@ -0,0 +1 @@
+vmlinux.lds
index 30a67a5..09a061c 100644 (file)
 /* 250 */      CALL(sys_epoll_create)
                CALL(ABI(sys_epoll_ctl, sys_oabi_epoll_ctl))
                CALL(ABI(sys_epoll_wait, sys_oabi_epoll_wait))
-               CALL(sys_remap_file_pages)
+               CALL(sys_remap_file_pages)
                CALL(sys_ni_syscall)    /* sys_set_thread_area */
 /* 255 */      CALL(sys_ni_syscall)    /* sys_get_thread_area */
-               CALL(sys_set_tid_address)
+               CALL(sys_set_tid_address)
                CALL(sys_timer_create)
                CALL(sys_timer_settime)
                CALL(sys_timer_gettime)
                CALL(sys_fallocate)
                CALL(sys_timerfd_settime)
                CALL(sys_timerfd_gettime)
+/* 355 */      CALL(sys_signalfd4)
+               CALL(sys_eventfd2)
+               CALL(sys_epoll_create1)
+               CALL(sys_dup3)
+               CALL(sys_pipe2)
+/* 360 */      CALL(sys_inotify_init1)
 #ifndef syscalls_counted
 .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
 #define syscalls_counted
index db8f54a..fae5beb 100644 (file)
@@ -71,7 +71,7 @@ void machine_kexec(struct kimage *image)
 
 
        flush_icache_range((unsigned long) reboot_code_buffer,
-                          (unsigned long) reboot_code_buffer + KEXEC_CONTROL_CODE_SIZE);
+                          (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
        printk(KERN_INFO "Bye!\n");
 
        cpu_proc_fin();
index 38f0e79..2ca7038 100644 (file)
@@ -81,6 +81,8 @@ EXPORT_SYMBOL(system_serial_high);
 unsigned int elf_hwcap;
 EXPORT_SYMBOL(elf_hwcap);
 
+unsigned long __initdata vmalloc_reserve = 128 << 20;
+
 
 #ifdef MULTI_CPU
 struct processor processor;
@@ -500,6 +502,17 @@ static void __init early_mem(char **p)
 }
 __early_param("mem=", early_mem);
 
+/*
+ * vmalloc=size forces the vmalloc area to be exactly 'size'
+ * bytes. This can be used to increase (or decrease) the vmalloc
+ * area - the default is 128m.
+ */
+static void __init early_vmalloc(char **arg)
+{
+       vmalloc_reserve = memparse(*arg, arg);
+}
+__early_param("vmalloc=", early_vmalloc);
+
 /*
  * Initial parsing of the command line.
  */
index 7277aef..872f1f8 100644 (file)
@@ -288,14 +288,28 @@ void unregister_undef_hook(struct undef_hook *hook)
        spin_unlock_irqrestore(&undef_lock, flags);
 }
 
+static int call_undef_hook(struct pt_regs *regs, unsigned int instr)
+{
+       struct undef_hook *hook;
+       unsigned long flags;
+       int (*fn)(struct pt_regs *regs, unsigned int instr) = NULL;
+
+       spin_lock_irqsave(&undef_lock, flags);
+       list_for_each_entry(hook, &undef_hook, node)
+               if ((instr & hook->instr_mask) == hook->instr_val &&
+                   (regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val)
+                       fn = hook->fn;
+       spin_unlock_irqrestore(&undef_lock, flags);
+
+       return fn ? fn(regs, instr) : 1;
+}
+
 asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
 {
        unsigned int correction = thumb_mode(regs) ? 2 : 4;
        unsigned int instr;
-       struct undef_hook *hook;
        siginfo_t info;
        void __user *pc;
-       unsigned long flags;
 
        /*
         * According to the ARM ARM, PC is 2 or 4 bytes ahead,
@@ -325,17 +339,8 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
        }
 #endif
 
-       spin_lock_irqsave(&undef_lock, flags);
-       list_for_each_entry(hook, &undef_hook, node) {
-               if ((instr & hook->instr_mask) == hook->instr_val &&
-                   (regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val) {
-                       if (hook->fn(regs, instr) == 0) {
-                               spin_unlock_irqrestore(&undef_lock, flags);
-                               return;
-                       }
-               }
-       }
-       spin_unlock_irqrestore(&undef_lock, flags);
+       if (call_undef_hook(regs, instr) == 0)
+               return;
 
 #ifdef CONFIG_DEBUG_USER
        if (user_debug & UDBG_UNDEFINED) {
index 35eb232..ae3e1c8 100644 (file)
@@ -18,6 +18,9 @@ static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 };
 
 static int __init cats_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 {
+       if (dev->irq >= 255)
+               return -1;      /* not a valid interrupt. */
+
        if (dev->irq >= 128)
                return dev->irq & 0x1f;
 
index ce5ea7c..7c49d55 100644 (file)
@@ -3,8 +3,6 @@
  *
  *  Copyright (C) 2001-2002 Deep Blue Solutions Ltd.
  *
- *  $Id: cpu.c,v 1.6 2002/07/18 13:58:51 rmk Exp $
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
index 83c4c1c..028b878 100644 (file)
@@ -26,8 +26,6 @@
  *     NOTE: This is a multi-hosted header file for use with uHAL and
  *           supported debuggers.
  *
- *     $Id: platform.s,v 1.32 2000/02/18 10:51:39 asims Exp $
- *
  * ***********************************************************************/
 
 #ifndef __address_h
index 0e509b8..189f16f 100644 (file)
 #include <linux/mbus.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/ata_platform.h>
+#include <linux/spi/orion_spi.h>
 #include <asm/page.h>
 #include <asm/timex.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
 #include <mach/kirkwood.h>
-#include <asm/plat-orion/cache-feroceon-l2.h>
-#include <asm/plat-orion/ehci-orion.h>
-#include <asm/plat-orion/orion_nand.h>
-#include <asm/plat-orion/time.h>
+#include <plat/cache-feroceon-l2.h>
+#include <plat/ehci-orion.h>
+#include <plat/mv_xor.h>
+#include <plat/orion_nand.h>
+#include <plat/time.h>
 #include "common.h"
 
 /*****************************************************************************
@@ -195,6 +197,37 @@ void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data)
 }
 
 
+/*****************************************************************************
+ * SPI
+ ****************************************************************************/
+static struct orion_spi_info kirkwood_spi_plat_data = {
+       .tclk           = KIRKWOOD_TCLK,
+};
+
+static struct resource kirkwood_spi_resources[] = {
+       {
+               .start  = SPI_PHYS_BASE,
+               .end    = SPI_PHYS_BASE + SZ_512 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device kirkwood_spi = {
+       .name           = "orion_spi",
+       .id             = 0,
+       .resource       = kirkwood_spi_resources,
+       .dev            = {
+               .platform_data  = &kirkwood_spi_plat_data,
+       },
+       .num_resources  = ARRAY_SIZE(kirkwood_spi_resources),
+};
+
+void __init kirkwood_spi_init()
+{
+       platform_device_register(&kirkwood_spi);
+}
+
+
 /*****************************************************************************
  * UART0
  ****************************************************************************/
@@ -283,6 +316,212 @@ void __init kirkwood_uart1_init(void)
 }
 
 
+/*****************************************************************************
+ * XOR
+ ****************************************************************************/
+static struct mv_xor_platform_shared_data kirkwood_xor_shared_data = {
+       .dram           = &kirkwood_mbus_dram_info,
+};
+
+static u64 kirkwood_xor_dmamask = DMA_32BIT_MASK;
+
+
+/*****************************************************************************
+ * XOR0
+ ****************************************************************************/
+static struct resource kirkwood_xor0_shared_resources[] = {
+       {
+               .name   = "xor 0 low",
+               .start  = XOR0_PHYS_BASE,
+               .end    = XOR0_PHYS_BASE + 0xff,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .name   = "xor 0 high",
+               .start  = XOR0_HIGH_PHYS_BASE,
+               .end    = XOR0_HIGH_PHYS_BASE + 0xff,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device kirkwood_xor0_shared = {
+       .name           = MV_XOR_SHARED_NAME,
+       .id             = 0,
+       .dev            = {
+               .platform_data = &kirkwood_xor_shared_data,
+       },
+       .num_resources  = ARRAY_SIZE(kirkwood_xor0_shared_resources),
+       .resource       = kirkwood_xor0_shared_resources,
+};
+
+static struct resource kirkwood_xor00_resources[] = {
+       [0] = {
+               .start  = IRQ_KIRKWOOD_XOR_00,
+               .end    = IRQ_KIRKWOOD_XOR_00,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct mv_xor_platform_data kirkwood_xor00_data = {
+       .shared         = &kirkwood_xor0_shared,
+       .hw_id          = 0,
+       .pool_size      = PAGE_SIZE,
+};
+
+static struct platform_device kirkwood_xor00_channel = {
+       .name           = MV_XOR_NAME,
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(kirkwood_xor00_resources),
+       .resource       = kirkwood_xor00_resources,
+       .dev            = {
+               .dma_mask               = &kirkwood_xor_dmamask,
+               .coherent_dma_mask      = DMA_64BIT_MASK,
+               .platform_data          = (void *)&kirkwood_xor00_data,
+       },
+};
+
+static struct resource kirkwood_xor01_resources[] = {
+       [0] = {
+               .start  = IRQ_KIRKWOOD_XOR_01,
+               .end    = IRQ_KIRKWOOD_XOR_01,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct mv_xor_platform_data kirkwood_xor01_data = {
+       .shared         = &kirkwood_xor0_shared,
+       .hw_id          = 1,
+       .pool_size      = PAGE_SIZE,
+};
+
+static struct platform_device kirkwood_xor01_channel = {
+       .name           = MV_XOR_NAME,
+       .id             = 1,
+       .num_resources  = ARRAY_SIZE(kirkwood_xor01_resources),
+       .resource       = kirkwood_xor01_resources,
+       .dev            = {
+               .dma_mask               = &kirkwood_xor_dmamask,
+               .coherent_dma_mask      = DMA_64BIT_MASK,
+               .platform_data          = (void *)&kirkwood_xor01_data,
+       },
+};
+
+void __init kirkwood_xor0_init(void)
+{
+       platform_device_register(&kirkwood_xor0_shared);
+
+       /*
+        * two engines can't do memset simultaneously, this limitation
+        * satisfied by removing memset support from one of the engines.
+        */
+       dma_cap_set(DMA_MEMCPY, kirkwood_xor00_data.cap_mask);
+       dma_cap_set(DMA_XOR, kirkwood_xor00_data.cap_mask);
+       platform_device_register(&kirkwood_xor00_channel);
+
+       dma_cap_set(DMA_MEMCPY, kirkwood_xor01_data.cap_mask);
+       dma_cap_set(DMA_MEMSET, kirkwood_xor01_data.cap_mask);
+       dma_cap_set(DMA_XOR, kirkwood_xor01_data.cap_mask);
+       platform_device_register(&kirkwood_xor01_channel);
+}
+
+
+/*****************************************************************************
+ * XOR1
+ ****************************************************************************/
+static struct resource kirkwood_xor1_shared_resources[] = {
+       {
+               .name   = "xor 1 low",
+               .start  = XOR1_PHYS_BASE,
+               .end    = XOR1_PHYS_BASE + 0xff,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .name   = "xor 1 high",
+               .start  = XOR1_HIGH_PHYS_BASE,
+               .end    = XOR1_HIGH_PHYS_BASE + 0xff,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device kirkwood_xor1_shared = {
+       .name           = MV_XOR_SHARED_NAME,
+       .id             = 1,
+       .dev            = {
+               .platform_data = &kirkwood_xor_shared_data,
+       },
+       .num_resources  = ARRAY_SIZE(kirkwood_xor1_shared_resources),
+       .resource       = kirkwood_xor1_shared_resources,
+};
+
+static struct resource kirkwood_xor10_resources[] = {
+       [0] = {
+               .start  = IRQ_KIRKWOOD_XOR_10,
+               .end    = IRQ_KIRKWOOD_XOR_10,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct mv_xor_platform_data kirkwood_xor10_data = {
+       .shared         = &kirkwood_xor1_shared,
+       .hw_id          = 0,
+       .pool_size      = PAGE_SIZE,
+};
+
+static struct platform_device kirkwood_xor10_channel = {
+       .name           = MV_XOR_NAME,
+       .id             = 2,
+       .num_resources  = ARRAY_SIZE(kirkwood_xor10_resources),
+       .resource       = kirkwood_xor10_resources,
+       .dev            = {
+               .dma_mask               = &kirkwood_xor_dmamask,
+               .coherent_dma_mask      = DMA_64BIT_MASK,
+               .platform_data          = (void *)&kirkwood_xor10_data,
+       },
+};
+
+static struct resource kirkwood_xor11_resources[] = {
+       [0] = {
+               .start  = IRQ_KIRKWOOD_XOR_11,
+               .end    = IRQ_KIRKWOOD_XOR_11,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct mv_xor_platform_data kirkwood_xor11_data = {
+       .shared         = &kirkwood_xor1_shared,
+       .hw_id          = 1,
+       .pool_size      = PAGE_SIZE,
+};
+
+static struct platform_device kirkwood_xor11_channel = {
+       .name           = MV_XOR_NAME,
+       .id             = 3,
+       .num_resources  = ARRAY_SIZE(kirkwood_xor11_resources),
+       .resource       = kirkwood_xor11_resources,
+       .dev            = {
+               .dma_mask               = &kirkwood_xor_dmamask,
+               .coherent_dma_mask      = DMA_64BIT_MASK,
+               .platform_data          = (void *)&kirkwood_xor11_data,
+       },
+};
+
+void __init kirkwood_xor1_init(void)
+{
+       platform_device_register(&kirkwood_xor1_shared);
+
+       /*
+        * two engines can't do memset simultaneously, this limitation
+        * satisfied by removing memset support from one of the engines.
+        */
+       dma_cap_set(DMA_MEMCPY, kirkwood_xor10_data.cap_mask);
+       dma_cap_set(DMA_XOR, kirkwood_xor10_data.cap_mask);
+       platform_device_register(&kirkwood_xor10_channel);
+
+       dma_cap_set(DMA_MEMCPY, kirkwood_xor11_data.cap_mask);
+       dma_cap_set(DMA_MEMSET, kirkwood_xor11_data.cap_mask);
+       dma_cap_set(DMA_XOR, kirkwood_xor11_data.cap_mask);
+       platform_device_register(&kirkwood_xor11_channel);
+}
+
+
 /*****************************************************************************
  * Time handling
  ****************************************************************************/
index 5dee2f6..69cd113 100644 (file)
@@ -33,8 +33,11 @@ void kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data);
 void kirkwood_pcie_init(void);
 void kirkwood_rtc_init(void);
 void kirkwood_sata_init(struct mv_sata_platform_data *sata_data);
+void kirkwood_spi_init(void);
 void kirkwood_uart0_init(void);
 void kirkwood_uart1_init(void);
+void kirkwood_xor0_init(void);
+void kirkwood_xor1_init(void);
 
 extern struct sys_timer kirkwood_timer;
 
index d1336b4..5c69992 100644 (file)
 
 #define USB_PHYS_BASE          (KIRKWOOD_REGS_PHYS_BASE | 0x50000)
 
+#define XOR0_PHYS_BASE         (KIRKWOOD_REGS_PHYS_BASE | 0x60800)
+#define XOR0_VIRT_BASE         (KIRKWOOD_REGS_VIRT_BASE | 0x60800)
+#define XOR1_PHYS_BASE         (KIRKWOOD_REGS_PHYS_BASE | 0x60900)
+#define XOR1_VIRT_BASE         (KIRKWOOD_REGS_VIRT_BASE | 0x60900)
+#define XOR0_HIGH_PHYS_BASE    (KIRKWOOD_REGS_PHYS_BASE | 0x60A00)
+#define XOR0_HIGH_VIRT_BASE    (KIRKWOOD_REGS_VIRT_BASE | 0x60A00)
+#define XOR1_HIGH_PHYS_BASE    (KIRKWOOD_REGS_PHYS_BASE | 0x60B00)
+#define XOR1_HIGH_VIRT_BASE    (KIRKWOOD_REGS_VIRT_BASE | 0x60B00)
+
 #define GE00_PHYS_BASE         (KIRKWOOD_REGS_PHYS_BASE | 0x70000)
 #define GE01_PHYS_BASE         (KIRKWOOD_REGS_PHYS_BASE | 0x74000)
 
index 302bb2c..5790643 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/io.h>
-#include <asm/plat-orion/irq.h>
+#include <plat/irq.h>
 #include "common.h"
 
 void __init kirkwood_init_irq(void)
index 8282d0f..2195fa3 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/pci.h>
 #include <linux/mbus.h>
 #include <asm/mach/pci.h>
-#include <asm/plat-orion/pcie.h>
+#include <plat/pcie.h>
 #include "common.h"
 
 
index 182230a..a3012d4 100644 (file)
@@ -18,6 +18,9 @@
 #include <linux/timer.h>
 #include <linux/ata_platform.h>
 #include <linux/mv643xx_eth.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/orion_spi.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
@@ -34,6 +37,21 @@ static struct mv_sata_platform_data rd88f6192_sata_data = {
        .n_ports        = 2,
 };
 
+static const struct flash_platform_data rd88F6192_spi_slave_data = {
+       .type           = "m25p128",
+};
+
+static struct spi_board_info __initdata rd88F6192_spi_slave_info[] = {
+       {
+               .modalias       = "m25p80",
+               .platform_data  = &rd88F6192_spi_slave_data,
+               .irq            = -1,
+               .max_speed_hz   = 20000000,
+               .bus_num        = 0,
+               .chip_select    = 0,
+       },
+};
+
 static void __init rd88f6192_init(void)
 {
        /*
@@ -45,7 +63,12 @@ static void __init rd88f6192_init(void)
        kirkwood_ge00_init(&rd88f6192_ge00_data);
        kirkwood_rtc_init();
        kirkwood_sata_init(&rd88f6192_sata_data);
+       spi_register_board_info(rd88F6192_spi_slave_info,
+                               ARRAY_SIZE(rd88F6192_spi_slave_info));
+       kirkwood_spi_init();
        kirkwood_uart0_init();
+       kirkwood_xor0_init();
+       kirkwood_xor1_init();
 }
 
 static int __init rd88f6192_pci_init(void)
index d8a4301..d96487a 100644 (file)
@@ -23,7 +23,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
 #include <mach/kirkwood.h>
-#include <asm/plat-orion/orion_nand.h>
+#include <plat/orion_nand.h>
 #include "common.h"
 
 static struct mtd_partition rd88f6281_nand_parts[] = {
index 132b1c4..5099161 100644 (file)
@@ -1,5 +1,4 @@
 /* ssp.h
-     $Id$
 
    written by Marc Singer
    6 Dec 2004
index df6e38e..a7f5027 100644 (file)
@@ -1,5 +1,4 @@
 /* lcd-panel.h
-     $Id$
 
    written by Marc Singer
    18 Jul 2005
index e20cdbc..c0d2d9d 100644 (file)
@@ -19,8 +19,8 @@
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
 #include <mach/loki.h>
-#include <asm/plat-orion/orion_nand.h>
-#include <asm/plat-orion/time.h>
+#include <plat/orion_nand.h>
+#include <plat/time.h>
 #include "common.h"
 
 /*****************************************************************************
index d839af9..5a48793 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <asm/io.h>
-#include <asm/plat-orion/irq.h>
+#include <plat/irq.h>
 #include "common.h"
 
 void __init loki_init_irq(void)
index e633f9c..953a26c 100644 (file)
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
 #include <mach/mv78xx0.h>
-#include <asm/plat-orion/cache-feroceon-l2.h>
-#include <asm/plat-orion/ehci-orion.h>
-#include <asm/plat-orion/orion_nand.h>
-#include <asm/plat-orion/time.h>
+#include <plat/cache-feroceon-l2.h>
+#include <plat/ehci-orion.h>
+#include <plat/orion_nand.h>
+#include <plat/time.h>
 #include "common.h"
 
 
index 3198abf..28248d3 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <mach/mv78xx0.h>
-#include <asm/plat-orion/irq.h>
+#include <plat/irq.h>
 #include "common.h"
 
 void __init mv78xx0_init_irq(void)
index b78e144..430ea84 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/pci.h>
 #include <linux/mbus.h>
 #include <asm/mach/pci.h>
-#include <asm/plat-orion/pcie.h>
+#include <plat/pcie.h>
 #include "common.h"
 
 struct pcie_port {
index 168eeac..7b11e55 100644 (file)
 #include <asm/mach/time.h>
 #include <mach/hardware.h>
 #include <mach/orion5x.h>
-#include <asm/plat-orion/ehci-orion.h>
-#include <asm/plat-orion/orion_nand.h>
-#include <asm/plat-orion/time.h>
+#include <plat/ehci-orion.h>
+#include <plat/mv_xor.h>
+#include <plat/orion_nand.h>
+#include <plat/time.h>
 #include "common.h"
 
 /*****************************************************************************
@@ -354,6 +355,103 @@ void __init orion5x_uart1_init(void)
 }
 
 
+/*****************************************************************************
+ * XOR engine
+ ****************************************************************************/
+static struct resource orion5x_xor_shared_resources[] = {
+       {
+               .name   = "xor low",
+               .start  = ORION5X_XOR_PHYS_BASE,
+               .end    = ORION5X_XOR_PHYS_BASE + 0xff,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .name   = "xor high",
+               .start  = ORION5X_XOR_PHYS_BASE + 0x200,
+               .end    = ORION5X_XOR_PHYS_BASE + 0x2ff,
+               .flags  = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device orion5x_xor_shared = {
+       .name           = MV_XOR_SHARED_NAME,
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(orion5x_xor_shared_resources),
+       .resource       = orion5x_xor_shared_resources,
+};
+
+static u64 orion5x_xor_dmamask = DMA_32BIT_MASK;
+
+static struct resource orion5x_xor0_resources[] = {
+       [0] = {
+               .start  = IRQ_ORION5X_XOR0,
+               .end    = IRQ_ORION5X_XOR0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct mv_xor_platform_data orion5x_xor0_data = {
+       .shared         = &orion5x_xor_shared,
+       .hw_id          = 0,
+       .pool_size      = PAGE_SIZE,
+};
+
+static struct platform_device orion5x_xor0_channel = {
+       .name           = MV_XOR_NAME,
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(orion5x_xor0_resources),
+       .resource       = orion5x_xor0_resources,
+       .dev            = {
+               .dma_mask               = &orion5x_xor_dmamask,
+               .coherent_dma_mask      = DMA_64BIT_MASK,
+               .platform_data          = (void *)&orion5x_xor0_data,
+       },
+};
+
+static struct resource orion5x_xor1_resources[] = {
+       [0] = {
+               .start  = IRQ_ORION5X_XOR1,
+               .end    = IRQ_ORION5X_XOR1,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct mv_xor_platform_data orion5x_xor1_data = {
+       .shared         = &orion5x_xor_shared,
+       .hw_id          = 1,
+       .pool_size      = PAGE_SIZE,
+};
+
+static struct platform_device orion5x_xor1_channel = {
+       .name           = MV_XOR_NAME,
+       .id             = 1,
+       .num_resources  = ARRAY_SIZE(orion5x_xor1_resources),
+       .resource       = orion5x_xor1_resources,
+       .dev            = {
+               .dma_mask               = &orion5x_xor_dmamask,
+               .coherent_dma_mask      = DMA_64BIT_MASK,
+               .platform_data          = (void *)&orion5x_xor1_data,
+       },
+};
+
+void __init orion5x_xor_init(void)
+{
+       platform_device_register(&orion5x_xor_shared);
+
+       /*
+        * two engines can't do memset simultaneously, this limitation
+        * satisfied by removing memset support from one of the engines.
+        */
+       dma_cap_set(DMA_MEMCPY, orion5x_xor0_data.cap_mask);
+       dma_cap_set(DMA_XOR, orion5x_xor0_data.cap_mask);
+       platform_device_register(&orion5x_xor0_channel);
+
+       dma_cap_set(DMA_MEMCPY, orion5x_xor1_data.cap_mask);
+       dma_cap_set(DMA_MEMSET, orion5x_xor1_data.cap_mask);
+       dma_cap_set(DMA_XOR, orion5x_xor1_data.cap_mask);
+       platform_device_register(&orion5x_xor1_channel);
+}
+
+
 /*****************************************************************************
  * Time handling
  ****************************************************************************/
@@ -382,6 +480,8 @@ static void __init orion5x_id(u32 *dev, u32 *rev, char **dev_name)
                        *dev_name = "MV88F5281-D2";
                } else if (*rev == MV88F5281_REV_D1) {
                        *dev_name = "MV88F5281-D1";
+               } else if (*rev == MV88F5281_REV_D0) {
+                       *dev_name = "MV88F5281-D0";
                } else {
                        *dev_name = "MV88F5281-Rev-Unsupported";
                }
@@ -416,6 +516,15 @@ void __init orion5x_init(void)
         * Setup Orion address map
         */
        orion5x_setup_cpu_mbus_bridge();
+
+       /*
+        * Don't issue "Wait for Interrupt" instruction if we are
+        * running on D0 5281 silicon.
+        */
+       if (dev == MV88F5281_DEV_ID && rev == MV88F5281_REV_D0) {
+               printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n");
+               disable_hlt();
+       }
 }
 
 /*
index f72cf0e..e75bd70 100644 (file)
@@ -32,6 +32,7 @@ void orion5x_i2c_init(void);
 void orion5x_sata_init(struct mv_sata_platform_data *sata_data);
 void orion5x_uart0_init(void);
 void orion5x_uart1_init(void);
+void orion5x_xor_init(void);
 
 /*
  * PCIe/PCI functions.
index 48ce6d0..ff13e90 100644 (file)
@@ -25,7 +25,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
 #include <mach/orion5x.h>
-#include <asm/plat-orion/orion_nand.h>
+#include <plat/orion_nand.h>
 #include "common.h"
 #include "mpp.h"
 
index f52a7d6..61eb74a 100644 (file)
@@ -73,6 +73,7 @@
 #define MV88F5182_REV_A2       2
 /* Orion-2 (88F5281) */
 #define MV88F5281_DEV_ID       0x5281
+#define MV88F5281_REV_D0       4
 #define MV88F5281_REV_D1       5
 #define MV88F5281_REV_D2       6
 
 #define ORION5X_USB0_VIRT_BASE         (ORION5X_REGS_VIRT_BASE | 0x50000)
 #define ORION5X_USB0_REG(x)            (ORION5X_USB0_VIRT_BASE | (x))
 
+#define ORION5X_XOR_PHYS_BASE          (ORION5X_REGS_PHYS_BASE | 0x60900)
+#define ORION5X_XOR_VIRT_BASE          (ORION5X_REGS_VIRT_BASE | 0x60900)
+#define ORION5X_XOR_REG(x)             (ORION5X_XOR_VIRT_BASE | (x))
+
 #define ORION5X_ETH_PHYS_BASE          (ORION5X_REGS_PHYS_BASE | 0x70000)
 #define ORION5X_ETH_VIRT_BASE          (ORION5X_REGS_VIRT_BASE | 0x70000)
 #define ORION5X_ETH_REG(x)             (ORION5X_ETH_VIRT_BASE | (x))
index cc2a017..2545ff9 100644 (file)
@@ -16,7 +16,7 @@
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <mach/orion5x.h>
-#include <asm/plat-orion/irq.h>
+#include <plat/irq.h>
 #include "common.h"
 
 /*****************************************************************************
index 0caaaac..cb72f1b 100644 (file)
@@ -25,7 +25,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/pci.h>
 #include <mach/orion5x.h>
-#include <asm/plat-orion/orion_nand.h>
+#include <plat/orion_nand.h>
 #include "common.h"
 #include "mpp.h"
 
@@ -356,6 +356,7 @@ static void __init kurobox_pro_init(void)
        orion5x_sata_init(&kurobox_pro_sata_data);
        orion5x_uart0_init();
        orion5x_uart1_init();
+       orion5x_xor_init();
 
        orion5x_setup_dev_boot_win(KUROBOX_PRO_NOR_BOOT_BASE,
                                   KUROBOX_PRO_NOR_BOOT_SIZE);
index 4403cc9..53ff189 100644 (file)
@@ -239,6 +239,7 @@ static void __init mss2_init(void)
        orion5x_i2c_init();
        orion5x_sata_init(&mss2_sata_data);
        orion5x_uart0_init();
+       orion5x_xor_init();
 
        orion5x_setup_dev_boot_win(MSS2_NOR_BOOT_BASE, MSS2_NOR_BOOT_SIZE);
        platform_device_register(&mss2_nor_flash);
index 67b2c0d..978d4d5 100644 (file)
@@ -203,6 +203,7 @@ static void __init mv2120_init(void)
        orion5x_i2c_init();
        orion5x_sata_init(&mv2120_sata_data);
        orion5x_uart0_init();
+       orion5x_xor_init();
 
        orion5x_setup_dev_boot_win(MV2120_NOR_BOOT_BASE, MV2120_NOR_BOOT_SIZE);
        platform_device_register(&mv2120_nor_flash);
index 256a4f6..fbceecc 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/pci.h>
 #include <linux/mbus.h>
 #include <asm/mach/pci.h>
-#include <asm/plat-orion/pcie.h>
+#include <plat/pcie.h>
 #include "common.h"
 
 /*****************************************************************************
index 8771cb7..4c3bcd7 100644 (file)
@@ -292,6 +292,7 @@ static void __init rd88f5182_init(void)
        orion5x_i2c_init();
        orion5x_sata_init(&rd88f5182_sata_data);
        orion5x_uart0_init();
+       orion5x_xor_init();
 
        orion5x_setup_dev_boot_win(RD88F5182_NOR_BOOT_BASE,
                                   RD88F5182_NOR_BOOT_SIZE);
index 809132d..dd65716 100644 (file)
@@ -207,12 +207,12 @@ static struct i2c_board_info __initdata qnap_ts209_i2c_rtc = {
 
 static struct gpio_keys_button qnap_ts209_buttons[] = {
        {
-               .code           = KEY_RESTART,
+               .code           = KEY_COPY,
                .gpio           = QNAP_TS209_GPIO_KEY_MEDIA,
                .desc           = "USB Copy Button",
                .active_low     = 1,
        }, {
-               .code           = KEY_POWER,
+               .code           = KEY_RESTART,
                .gpio           = QNAP_TS209_GPIO_KEY_RESET,
                .desc           = "Reset Button",
                .active_low     = 1,
@@ -296,6 +296,7 @@ static void __init qnap_ts209_init(void)
        orion5x_i2c_init();
        orion5x_sata_init(&qnap_ts209_sata_data);
        orion5x_uart0_init();
+       orion5x_xor_init();
 
        orion5x_setup_dev_boot_win(QNAP_TS209_NOR_BOOT_BASE,
                                   QNAP_TS209_NOR_BOOT_SIZE);
index 6053e76..b27d2b7 100644 (file)
@@ -3,6 +3,9 @@
  *
  * Maintainer: Sylver Bruneau <sylver.bruneau@gmail.com>
  *
+ * Copyright (C) 2008  Sylver Bruneau <sylver.bruneau@gmail.com>
+ * Copyright (C) 2008  Martin Michlmayr <tbm@cyrius.com>
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version
@@ -16,6 +19,7 @@
 #include <linux/irq.h>
 #include <linux/mtd/physmap.h>
 #include <linux/mv643xx_eth.h>
+#include <linux/leds.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
 #include <linux/i2c.h>
@@ -162,16 +166,59 @@ static struct i2c_board_info __initdata qnap_ts409_i2c_rtc = {
        I2C_BOARD_INFO("s35390a", 0x30),
 };
 
+/*****************************************************************************
+ * LEDs attached to GPIO
+ ****************************************************************************/
+
+static struct gpio_led ts409_led_pins[] = {
+       {
+               .name           = "ts409:red:sata1",
+               .gpio           = 4,
+               .active_low     = 1,
+       }, {
+               .name           = "ts409:red:sata2",
+               .gpio           = 5,
+               .active_low     = 1,
+       }, {
+               .name           = "ts409:red:sata3",
+               .gpio           = 6,
+               .active_low     = 1,
+       }, {
+               .name           = "ts409:red:sata4",
+               .gpio           = 7,
+               .active_low     = 1,
+       },
+};
+
+static struct gpio_led_platform_data ts409_led_data = {
+       .leds           = ts409_led_pins,
+       .num_leds       = ARRAY_SIZE(ts409_led_pins),
+};
+
+static struct platform_device ts409_leds = {
+       .name   = "leds-gpio",
+       .id     = -1,
+       .dev    = {
+               .platform_data  = &ts409_led_data,
+       },
+};
+
 /****************************************************************************
  * GPIO Attached Keys
  *     Power button is attached to the PIC microcontroller
  ****************************************************************************/
 
+#define QNAP_TS409_GPIO_KEY_RESET      14
 #define QNAP_TS409_GPIO_KEY_MEDIA      15
 
 static struct gpio_keys_button qnap_ts409_buttons[] = {
        {
                .code           = KEY_RESTART,
+               .gpio           = QNAP_TS409_GPIO_KEY_RESET,
+               .desc           = "Reset Button",
+               .active_low     = 1,
+       }, {
+               .code           = KEY_COPY,
                .gpio           = QNAP_TS409_GPIO_KEY_MEDIA,
                .desc           = "USB Copy Button",
                .active_low     = 1,
@@ -255,6 +302,7 @@ static void __init qnap_ts409_init(void)
        if (qnap_ts409_i2c_rtc.irq == 0)
                pr_warning("qnap_ts409_init: failed to get RTC IRQ\n");
        i2c_register_board_info(0, &qnap_ts409_i2c_rtc, 1);
+       platform_device_register(&ts409_leds);
 
        /* register tsx09 specific power-off method */
        pm_power_off = qnap_tsx09_power_off;
index 014916a..ae0a5dc 100644 (file)
@@ -256,6 +256,7 @@ static void __init ts78xx_init(void)
        orion5x_sata_init(&ts78xx_sata_data);
        orion5x_uart0_init();
        orion5x_uart1_init();
+       orion5x_xor_init();
 
        orion5x_setup_dev_boot_win(TS78XX_NOR_BOOT_BASE,
                                   TS78XX_NOR_BOOT_SIZE);
index 351f32f..4d452fc 100644 (file)
@@ -10,8 +10,6 @@
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
- *
- * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $
  */
 
 #ifndef __ARCH_PXA_MTD_XIP_H__
index 8956afe..67debc4 100644 (file)
 #define POODLE_SCOOP_IO_DIR    ( POODLE_SCOOP_VPEN | POODLE_SCOOP_HS_OUT )
 #define POODLE_SCOOP_IO_OUT    ( 0 )
 
+#define POODLE_LOCOMO_GPIO_AMP_ON      LOCOMO_GPIO(8)
+#define POODLE_LOCOMO_GPIO_MUTE_L      LOCOMO_GPIO(10)
+#define POODLE_LOCOMO_GPIO_MUTE_R      LOCOMO_GPIO(11)
+#define POODLE_LOCOMO_GPIO_232VCC_ON   LOCOMO_GPIO(12)
+#define POODLE_LOCOMO_GPIO_JK_B        LOCOMO_GPIO(13)
+
 extern struct platform_device poodle_locomo_device;
 
 #endif /* __ASM_ARCH_POODLE_H  */
index 6544754..8e59111 100644 (file)
@@ -28,6 +28,7 @@
  * bits 10-17 : for AC Bias Pin Frequency
  * bit     18 : for output enable polarity
  * bit     19 : for pixel clock edge
+ * bit     20 : for output pixel format when base is RGBT16
  */
 #define LCD_CONN_TYPE(_x)      ((_x) & 0x0f)
 #define LCD_CONN_WIDTH(_x)     (((_x) >> 4) & 0x1f)
 #define LCD_SMART_PANEL_18BPP  ((18 << 4) | LCD_TYPE_SMART_PANEL)
 
 #define LCD_AC_BIAS_FREQ(x)    (((x) & 0xff) << 10)
-#define LCD_BIAS_ACTIVE_HIGH   (0 << 17)
-#define LCD_BIAS_ACTIVE_LOW    (1 << 17)
-#define LCD_PCLK_EDGE_RISE     (0 << 18)
-#define LCD_PCLK_EDGE_FALL     (1 << 18)
+#define LCD_BIAS_ACTIVE_HIGH   (0 << 18)
+#define LCD_BIAS_ACTIVE_LOW    (1 << 18)
+#define LCD_PCLK_EDGE_RISE     (0 << 19)
+#define LCD_PCLK_EDGE_FALL     (1 << 19)
+#define LCD_ALTERNATE_MAPPING  (1 << 20)
 
 /*
  * This structure describes the machine which we are running on.
index d583688..b3f90aa 100644 (file)
@@ -11,7 +11,7 @@
 */
 
 #ifndef __ASM_ARM_REGS_CLOCK
-#define __ASM_ARM_REGS_CLOCK "$Id: clock.h,v 1.4 2003/04/30 14:50:51 ben Exp $"
+#define __ASM_ARM_REGS_CLOCK
 
 #define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
 
index 30bec02..528080c 100644 (file)
@@ -12,7 +12,7 @@
 
 
 #ifndef __ASM_ARCH_REGS_GPIO_H
-#define __ASM_ARCH_REGS_GPIO_H "$Id: gpio.h,v 1.5 2003/05/19 12:51:08 ben Exp $"
+#define __ASM_ARCH_REGS_GPIO_H
 
 #define S3C2410_GPIONO(bank,offset) ((bank) + (offset))
 
index b057c06..de86ee8 100644 (file)
@@ -10,7 +10,7 @@
 
 
 #ifndef ___ASM_ARCH_REGS_IRQ_H
-#define ___ASM_ARCH_REGS_IRQ_H "$Id: irq.h,v 1.3 2003/03/25 21:29:06 ben Exp $"
+#define ___ASM_ARCH_REGS_IRQ_H
 
 /* interrupt controller */
 
index 893b874..ee8f040 100644 (file)
@@ -10,7 +10,7 @@
 
 
 #ifndef ___ASM_ARCH_REGS_LCD_H
-#define ___ASM_ARCH_REGS_LCD_H "$Id: lcd.h,v 1.3 2003/06/26 13:25:06 ben Exp $"
+#define ___ASM_ARCH_REGS_LCD_H
 
 #define S3C2410_LCDREG(x)      (x)
 
index f9926ab..5775980 100644 (file)
@@ -11,7 +11,7 @@
 */
 
 #ifndef __ASM_ARM_MEMREGS_H
-#define __ASM_ARM_MEMREGS_H "$Id: regs.h,v 1.8 2003/05/01 15:55:41 ben Exp $"
+#define __ASM_ARM_MEMREGS_H
 
 #ifndef S3C2410_MEMREG
 #define S3C2410_MEMREG(x) (S3C24XX_VA_MEMCTRL + (x))
index fb1e78e..24c6334 100644 (file)
@@ -562,7 +562,7 @@ static struct platform_device *bast_devices[] __initdata = {
        &bast_sio,
 };
 
-static struct clk *bast_clocks[] = {
+static struct clk *bast_clocks[] __initdata = {
        &s3c24xx_dclk0,
        &s3c24xx_dclk1,
        &s3c24xx_clkout0,
index c904008..b88939d 100644 (file)
@@ -5,7 +5,6 @@
  * Copyright (C) 2004 by FS Forth-Systeme GmbH
  * All rights reserved.
  *
- * $Id: mach-smdk2410.c,v 1.1 2004/05/11 14:15:38 mpietrek Exp $
  * @Author: Jonas Dietsche
  *
  * This program is free software; you can redistribute it and/or
index 12cbca6..fbc0213 100644 (file)
@@ -344,7 +344,7 @@ static struct platform_device *vr1000_devices[] __initdata = {
        &vr1000_led3,
 };
 
-static struct clk *vr1000_clocks[] = {
+static struct clk *vr1000_clocks[] __initdata = {
        &s3c24xx_dclk0,
        &s3c24xx_dclk1,
        &s3c24xx_clkout0,
index 30f613a..4c061d2 100644 (file)
@@ -26,9 +26,6 @@
 
 #include <linux/spi/spi.h>
 
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/partitions.h>
-
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
index 265c77d..441f4bc 100644 (file)
@@ -414,7 +414,7 @@ static struct platform_device *anubis_devices[] __initdata = {
        &anubis_device_sm501,
 };
 
-static struct clk *anubis_clocks[] = {
+static struct clk *anubis_clocks[] __initdata = {
        &s3c24xx_dclk0,
        &s3c24xx_dclk1,
        &s3c24xx_clkout0,
index d2ee0cd..8b83f93 100644 (file)
@@ -341,7 +341,7 @@ static struct platform_device *osiris_devices[] __initdata = {
        &osiris_pcmcia,
 };
 
-static struct clk *osiris_clocks[] = {
+static struct clk *osiris_clocks[] __initdata = {
        &s3c24xx_dclk0,
        &s3c24xx_dclk1,
        &s3c24xx_clkout0,
index 39d38c8..029dbfb 100644 (file)
@@ -3,8 +3,6 @@
  *
  *  Copyright (C) 2001 Russell King
  *
- *  $Id: cpu-sa1110.c,v 1.9 2002/07/06 16:53:18 rmk Exp $
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
index 80cfdac..eaa09e8 100644 (file)
@@ -10,8 +10,6 @@
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
- *
- * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $
  */
 
 #ifndef __ARCH_SA1100_MTD_XIP_H__
index 20eec4b..7b5a25d 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <linux/init.h>
 #include <asm/cacheflush.h>
-#include <asm/plat-orion/cache-feroceon-l2.h>
+#include <plat/cache-feroceon-l2.h>
 
 
 /*
index 2d6d682..25d9a11 100644 (file)
@@ -568,6 +568,55 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
                create_mapping(io_desc + i);
 }
 
+static int __init check_membank_valid(struct membank *mb)
+{
+       /*
+        * Check whether this memory region has non-zero size.
+        */
+       if (mb->size == 0)
+               return 0;
+
+       /*
+        * Check whether this memory region would entirely overlap
+        * the vmalloc area.
+        */
+       if (phys_to_virt(mb->start) >= VMALLOC_MIN) {
+               printk(KERN_NOTICE "Ignoring RAM at %.8lx-%.8lx "
+                       "(vmalloc region overlap).\n",
+                       mb->start, mb->start + mb->size - 1);
+               return 0;
+       }
+
+       /*
+        * Check whether this memory region would partially overlap
+        * the vmalloc area.
+        */
+       if (phys_to_virt(mb->start + mb->size) < phys_to_virt(mb->start) ||
+           phys_to_virt(mb->start + mb->size) > VMALLOC_MIN) {
+               unsigned long newsize = VMALLOC_MIN - phys_to_virt(mb->start);
+
+               printk(KERN_NOTICE "Truncating RAM at %.8lx-%.8lx "
+                       "to -%.8lx (vmalloc region overlap).\n",
+                       mb->start, mb->start + mb->size - 1,
+                       mb->start + newsize - 1);
+               mb->size = newsize;
+       }
+
+       return 1;
+}
+
+static void __init sanity_check_meminfo(struct meminfo *mi)
+{
+       int i;
+       int j;
+
+       for (i = 0, j = 0; i < mi->nr_banks; i++) {
+               if (check_membank_valid(&mi->bank[i]))
+                       mi->bank[j++] = mi->bank[i];
+       }
+       mi->nr_banks = j;
+}
+
 static inline void prepare_page_table(struct meminfo *mi)
 {
        unsigned long addr;
@@ -753,6 +802,7 @@ void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc)
        void *zero_page;
 
        build_mem_type_table();
+       sanity_check_meminfo(mi);
        prepare_page_table(mi);
        bootmem_init(mi);
        devicemaps_init(mdesc);
index 1a3d63d..551244d 100644 (file)
@@ -15,6 +15,7 @@
 #include <asm/pgtable-hwdef.h>
 #include <asm/pgtable.h>
 #include <asm/ptrace.h>
+#include "proc-macros.S"
 
 /* ARM940T has a 4KB DCache comprising 256 lines of 4 words */
 #define CACHE_DLINESIZE        16
index 82d579a..6168c61 100644 (file)
@@ -17,6 +17,7 @@
 #include <asm/pgtable-hwdef.h>
 #include <asm/pgtable.h>
 #include <asm/ptrace.h>
+#include "proc-macros.S"
 
 /*
  * ARM946E-S is synthesizable to have 0KB to 1MB sized D-Cache,
index 037486c..a325caf 100644 (file)
                                        (dma_addr_t)virt_to_lbus(page_address(page)) : \
                                        (dma_addr_t)__virt_to_bus(page_address(page));})
 
-#define __arch_dma_to_virt(dev, addr)  ({is_lbus_device(dev) ? \
-                                       lbus_to_virt(addr) : \
-                                       __bus_to_virt(addr);})
-
-#define __arch_virt_to_dma(dev, addr)  ({is_lbus_device(dev) ? \
-                                       virt_to_lbus(addr) : \
-                                       __virt_to_bus(addr);})
+#define __arch_dma_to_virt(dev, addr)  ({ (void *) (is_lbus_device(dev) ? \
+                                               lbus_to_virt(addr) : \
+                                               __bus_to_virt(addr)); })
+
+#define __arch_virt_to_dma(dev, addr)  ({ unsigned long __addr = (unsigned long)(addr); \
+                                          (dma_addr_t) (is_lbus_device(dev) ? \
+                                               virt_to_lbus(__addr) : \
+                                               __virt_to_bus(__addr)); })
 
 #endif /* CONFIG_ARCH_OMAP15XX */
 
diff --git a/arch/arm/plat-orion/include/plat/cache-feroceon-l2.h b/arch/arm/plat-orion/include/plat/cache-feroceon-l2.h
new file mode 100644 (file)
index 0000000..06f982d
--- /dev/null
@@ -0,0 +1,11 @@
+/*
+ * arch/arm/plat-orion/include/plat/cache-feroceon-l2.h
+ *
+ * Copyright (C) 2008 Marvell Semiconductor
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+extern void __init feroceon_l2_init(int l2_wt_override);
diff --git a/arch/arm/plat-orion/include/plat/ehci-orion.h b/arch/arm/plat-orion/include/plat/ehci-orion.h
new file mode 100644 (file)
index 0000000..6434305
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * arch/arm/plat-orion/include/plat/ehci-orion.h
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __PLAT_EHCI_ORION_H
+#define __PLAT_EHCI_ORION_H
+
+#include <linux/mbus.h>
+
+struct orion_ehci_data {
+       struct mbus_dram_target_info    *dram;
+};
+
+
+#endif
diff --git a/arch/arm/plat-orion/include/plat/irq.h b/arch/arm/plat-orion/include/plat/irq.h
new file mode 100644 (file)
index 0000000..f05eeab
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * arch/arm/plat-orion/include/plat/irq.h
+ *
+ * Marvell Orion SoC IRQ handling.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __PLAT_IRQ_H
+#define __PLAT_IRQ_H
+
+void orion_irq_init(unsigned int irq_start, void __iomem *maskaddr);
+
+
+#endif
diff --git a/arch/arm/plat-orion/include/plat/mv_xor.h b/arch/arm/plat-orion/include/plat/mv_xor.h
new file mode 100644 (file)
index 0000000..bd5f3bd
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * arch/arm/plat-orion/include/plat/mv_xor.h
+ *
+ * Marvell XOR platform device data definition file.
+ */
+
+#ifndef __PLAT_MV_XOR_H
+#define __PLAT_MV_XOR_H
+
+#include <linux/dmaengine.h>
+#include <linux/mbus.h>
+
+#define MV_XOR_SHARED_NAME     "mv_xor_shared"
+#define MV_XOR_NAME            "mv_xor"
+
+struct mbus_dram_target_info;
+
+struct mv_xor_platform_shared_data {
+       struct mbus_dram_target_info    *dram;
+};
+
+struct mv_xor_platform_data {
+       struct platform_device          *shared;
+       int                             hw_id;
+       dma_cap_mask_t                  cap_mask;
+       size_t                          pool_size;
+};
+
+
+#endif
diff --git a/arch/arm/plat-orion/include/plat/orion_nand.h b/arch/arm/plat-orion/include/plat/orion_nand.h
new file mode 100644 (file)
index 0000000..d6a4cfa
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * arch/arm/plat-orion/include/plat/orion_nand.h
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __PLAT_ORION_NAND_H
+#define __PLAT_ORION_NAND_H
+
+/*
+ * Device bus NAND private data
+ */
+struct orion_nand_data {
+       struct mtd_partition *parts;
+       u32 nr_parts;
+       u8 ale;         /* address line number connected to ALE */
+       u8 cle;         /* address line number connected to CLE */
+       u8 width;       /* buswidth */
+       u8 chip_delay;
+};
+
+
+#endif
diff --git a/arch/arm/plat-orion/include/plat/pcie.h b/arch/arm/plat-orion/include/plat/pcie.h
new file mode 100644 (file)
index 0000000..3ebfef7
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * arch/arm/plat-orion/include/plat/pcie.h
+ *
+ * Marvell Orion SoC PCIe handling.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __PLAT_PCIE_H
+#define __PLAT_PCIE_H
+
+u32 orion_pcie_dev_id(void __iomem *base);
+u32 orion_pcie_rev(void __iomem *base);
+int orion_pcie_link_up(void __iomem *base);
+int orion_pcie_x4_mode(void __iomem *base);
+int orion_pcie_get_local_bus_nr(void __iomem *base);
+void orion_pcie_set_local_bus_nr(void __iomem *base, int nr);
+void orion_pcie_setup(void __iomem *base,
+                     struct mbus_dram_target_info *dram);
+int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus,
+                      u32 devfn, int where, int size, u32 *val);
+int orion_pcie_rd_conf_tlp(void __iomem *base, struct pci_bus *bus,
+                          u32 devfn, int where, int size, u32 *val);
+int orion_pcie_rd_conf_wa(void __iomem *wa_base, struct pci_bus *bus,
+                         u32 devfn, int where, int size, u32 *val);
+int orion_pcie_wr_conf(void __iomem *base, struct pci_bus *bus,
+                      u32 devfn, int where, int size, u32 val);
+
+
+#endif
diff --git a/arch/arm/plat-orion/include/plat/time.h b/arch/arm/plat-orion/include/plat/time.h
new file mode 100644 (file)
index 0000000..c06ca35
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * arch/arm/plat-orion/include/plat/time.h
+ *
+ * Marvell Orion SoC time handling.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __PLAT_TIME_H
+#define __PLAT_TIME_H
+
+void orion_time_init(unsigned int irq, unsigned int tclk);
+
+
+#endif
index fe66a18..3f9d34f 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/io.h>
-#include <asm/plat-orion/irq.h>
+#include <plat/irq.h>
 
 static void orion_irq_mask(u32 irq)
 {
index ca32c60..883902f 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/pci.h>
 #include <linux/mbus.h>
 #include <asm/mach/pci.h>
-#include <asm/plat-orion/pcie.h>
+#include <plat/pcie.h>
 
 /*
  * PCIe unit register offsets.
index 6d60f04..89ce60e 100644 (file)
@@ -169,9 +169,7 @@ static struct map_desc s3c_iodesc[] __initdata = {
        IODESC_ENT(UART)
 };
 
-
-static struct cpu_table *
-s3c_lookup_cpu(unsigned long idcode)
+static struct cpu_table * __init s3c_lookup_cpu(unsigned long idcode)
 {
        struct cpu_table *tab;
        int count;
index 8b8f564..56281c0 100644 (file)
@@ -12,7 +12,7 @@
 #
 #   http://www.arm.linux.org.uk/developer/machines/?action=new
 #
-# Last update: Sun Jul 13 12:04:05 2008
+# Last update: Wed Aug 13 21:56:02 2008
 #
 # machine_is_xxx       CONFIG_xxxx             MACH_TYPE_xxx           number
 #
@@ -843,7 +843,7 @@ borzoi                      MACH_BORZOI             BORZOI                  831
 gecko                  MACH_GECKO              GECKO                   832
 ds101                  MACH_DS101              DS101                   833
 omap_palmtt2           MACH_OMAP_PALMTT2       OMAP_PALMTT2            834
-xscale_palmld          MACH_XSCALE_PALMLD      XSCALE_PALMLD           835
+palmld                 MACH_PALMLD             PALMLD                  835
 cc9c                   MACH_CC9C               CC9C                    836
 sbc1670                        MACH_SBC1670            SBC1670                 837
 ixdp28x5               MACH_IXDP28X5           IXDP28X5                838
@@ -852,7 +852,7 @@ ml696k                      MACH_ML696K             ML696K                  840
 arcom_zeus             MACH_ARCOM_ZEUS         ARCOM_ZEUS              841
 osiris                 MACH_OSIRIS             OSIRIS                  842
 maestro                        MACH_MAESTRO            MAESTRO                 843
-tunge2                 MACH_TUNGE2             TUNGE2                  844
+palmte2                        MACH_PALMTE2            PALMTE2                 844
 ixbbm                  MACH_IXBBM              IXBBM                   845
 mx27ads                        MACH_MX27ADS            MX27ADS                 846
 ax8004                 MACH_AX8004             AX8004                  847
@@ -916,7 +916,7 @@ nxdb500                     MACH_NXDB500            NXDB500                 905
 apf9328                        MACH_APF9328            APF9328                 906
 omap_wipoq             MACH_OMAP_WIPOQ         OMAP_WIPOQ              907
 omap_twip              MACH_OMAP_TWIP          OMAP_TWIP               908
-palmtreo650            MACH_PALMTREO650        PALMTREO650             909
+palmt650               MACH_PALMT650           PALMT650                909
 acumen                 MACH_ACUMEN             ACUMEN                  910
 xp100                  MACH_XP100              XP100                   911
 fs2410                 MACH_FS2410             FS2410                  912
@@ -1096,7 +1096,7 @@ atc6                      MACH_ATC6               ATC6                    1086
 multmdw                        MACH_MULTMDW            MULTMDW                 1087
 mba2440                        MACH_MBA2440            MBA2440                 1088
 ecsd                   MACH_ECSD               ECSD                    1089
-zire31                 MACH_ZIRE31             ZIRE31                  1090
+palmz31                        MACH_PALMZ31            PALMZ31                 1090
 fsg                    MACH_FSG                FSG                     1091
 razor101               MACH_RAZOR101           RAZOR101                1092
 opera_tdm              MACH_OPERA_TDM          OPERA_TDM               1093
@@ -1810,7 +1810,7 @@ kriss_sensor              MACH_KRISS_SENSOR       KRISS_SENSOR            1819
 pilz_pmi5              MACH_PILZ_PMI5          PILZ_PMI5               1820
 jade                   MACH_JADE               JADE                    1821
 ks8695_softplc         MACH_KS8695_SOFTPLC     KS8695_SOFTPLC          1822
-gprisc4                        MACH_GPRISC4            GPRISC4                 1823
+gprisc3                        MACH_GPRISC4            GPRISC4                 1823
 stamp9260              MACH_STAMP9260          STAMP9260               1824
 smdk6430               MACH_SMDK6430           SMDK6430                1825
 smdkc100               MACH_SMDKC100           SMDKC100                1826
@@ -1820,3 +1820,44 @@ deister_eyecam           MACH_DEISTER_EYECAM     DEISTER_EYECAM          1829
 at91sam9m10ek          MACH_AT91SAM9M10EK      AT91SAM9M10EK           1830
 linkstation_produo     MACH_LINKSTATION_PRODUO LINKSTATION_PRODUO      1831
 hit_b0                 MACH_HIT_B0             HIT_B0                  1832
+adx_rmu                        MACH_ADX_RMU            ADX_RMU                 1833
+xg_cpe_main            MACH_XG_CPE_MAIN        XG_CPE_MAIN             1834
+edb9407a               MACH_EDB9407A           EDB9407A                1835
+dtb9608                        MACH_DTB9608            DTB9608                 1836
+em104v1                        MACH_EM104V1            EM104V1                 1837
+demo                   MACH_DEMO               DEMO                    1838
+logi9260               MACH_LOGI9260           LOGI9260                1839
+mx31_exm32             MACH_MX31_EXM32         MX31_EXM32              1840
+usb_a9g20              MACH_USB_A9G20          USB_A9G20               1841
+picproje2008           MACH_PICPROJE2008       PICPROJE2008            1842
+cs_e9315               MACH_CS_E9315           CS_E9315                1843
+qil_a9g20              MACH_QIL_A9G20          QIL_A9G20               1844
+sha_pon020             MACH_SHA_PON020         SHA_PON020              1845
+nad                    MACH_NAD                NAD                     1846
+sbc35_a9260            MACH_SBC35_A9260        SBC35_A9260             1847
+sbc35_a9g20            MACH_SBC35_A9G20        SBC35_A9G20             1848
+davinci_beginning      MACH_DAVINCI_BEGINNING  DAVINCI_BEGINNING       1849
+uwc                    MACH_UWC                UWC                     1850
+mxlads                 MACH_MXLADS             MXLADS                  1851
+htcnike                        MACH_HTCNIKE            HTCNIKE                 1852
+deister_pxa270         MACH_DEISTER_PXA270     DEISTER_PXA270          1853
+cme9210js              MACH_CME9210JS          CME9210JS               1854
+cc9p9360               MACH_CC9P9360           CC9P9360                1855
+mocha                  MACH_MOCHA              MOCHA                   1856
+wapd170ag              MACH_WAPD170AG          WAPD170AG               1857
+linkstation_mini       MACH_LINKSTATION_MINI   LINKSTATION_MINI        1858
+afeb9260               MACH_AFEB9260           AFEB9260                1859
+w90x900                        MACH_W90X900            W90X900                 1860
+w90x700                        MACH_W90X700            W90X700                 1861
+kt300ip                        MACH_KT300IP            KT300IP                 1862
+kt300ip_g20            MACH_KT300IP_G20        KT300IP_G20             1863
+srcm                   MACH_SRCM               SRCM                    1864
+wlnx_9260              MACH_WLNX_9260          WLNX_9260               1865
+openmoko_gta03         MACH_OPENMOKO_GTA03     OPENMOKO_GTA03          1866
+osprey2                        MACH_OSPREY2            OSPREY2                 1867
+kbio9260               MACH_KBIO9260           KBIO9260                1868
+ginza                  MACH_GINZA              GINZA                   1869
+a636n                  MACH_A636N              A636N                   1870
+imx27ipcam             MACH_IMX27IPCAM         IMX27IPCAM              1871
+nenoc                  MACH_NEMOC              NEMOC                   1872
+geneva                 MACH_GENEVA             GENEVA                  1873
index 5a097c4..f64d259 100644 (file)
@@ -249,7 +249,7 @@ config MEM_MT48LC8M32B2B5_7
 
 config MEM_MT48LC32M16A2TG_75
        bool
-       depends on (BFIN527_EZKIT || BFIN532_IP0X)
+       depends on (BFIN527_EZKIT || BFIN532_IP0X || BLACKSTAMP)
        default y
 
 source "arch/blackfin/mach-bf527/Kconfig"
@@ -292,7 +292,7 @@ config CLKIN_HZ
        int "Frequency of the crystal on the board in Hz"
        default "11059200" if BFIN533_STAMP
        default "27000000" if BFIN533_EZKIT
-       default "25000000" if (BFIN537_STAMP || BFIN527_EZKIT || H8606_HVSISTEMAS)
+       default "25000000" if (BFIN537_STAMP || BFIN527_EZKIT || H8606_HVSISTEMAS || BLACKSTAMP)
        default "30000000" if BFIN561_EZKIT
        default "24576000" if PNAV10
        default "10000000" if BFIN532_IP0X
@@ -332,7 +332,7 @@ config VCO_MULT
        default "22" if BFIN533_BLUETECHNIX_CM
        default "20" if (BFIN537_BLUETECHNIX_CM || BFIN527_BLUETECHNIX_CM || BFIN561_BLUETECHNIX_CM)
        default "20" if BFIN561_EZKIT
-       default "16" if H8606_HVSISTEMAS
+       default "16" if (H8606_HVSISTEMAS || BLACKSTAMP)
        help
          This controls the frequency of the on-chip PLL. This can be between 1 and 64.
          PLL Frequency = (Crystal Frequency) * (this setting)
@@ -622,6 +622,33 @@ config CPLB_SWITCH_TAB_L1
          If enabled, the CPLB Switch Tables are linked
          into L1 data memory. (less latency)
 
+comment "Speed Optimizations"
+config BFIN_INS_LOWOVERHEAD
+       bool "ins[bwl] low overhead, higher interrupt latency"
+       default y
+       help
+         Reads on the Blackfin are speculative. In Blackfin terms, this means
+         they can be interrupted at any time (even after they have been issued
+         on to the external bus), and re-issued after the interrupt occurs.
+         For memory - this is not a big deal, since memory does not change if
+         it sees a read.
+
+         If a FIFO is sitting on the end of the read, it will see two reads,
+         when the core only sees one since the FIFO receives both the read
+         which is cancelled (and not delivered to the core) and the one which
+         is re-issued (which is delivered to the core).
+
+         To solve this, interrupts are turned off before reads occur to
+         I/O space. This option controls which the overhead/latency of
+         controlling interrupts during this time
+          "n" turns interrupts off every read
+               (higher overhead, but lower interrupt latency)
+          "y" turns interrupts off every loop
+               (low overhead, but longer interrupt latency)
+
+         default behavior is to leave this set to on (type "Y"). If you are experiencing
+         interrupt latency issues, it is safe and OK to turn this off.
+
 endmenu
 
 
@@ -933,13 +960,6 @@ endchoice
 comment "Possible Suspend Mem / Hibernate Wake-Up Sources"
        depends on PM
 
-config PM_BFIN_WAKE_RTC
-       bool "Allow Wake-Up from RESET and on-chip RTC"
-       depends on PM
-       default n
-       help
-         Enable RTC Wake-Up (Voltage Regulator Power-Up)
-
 config PM_BFIN_WAKE_PH6
        bool "Allow Wake-Up from on-chip PHY or PH6 GP"
        depends on PM && (BF52x || BF534 || BF536 || BF537)
@@ -947,41 +967,12 @@ config PM_BFIN_WAKE_PH6
        help
          Enable PHY and PH6 GP Wake-Up (Voltage Regulator Power-Up)
 
-config PM_BFIN_WAKE_CAN
-       bool "Allow Wake-Up from on-chip CAN0/1"
-       depends on PM && (BF54x || BF534 || BF536 || BF537)
-       default n
-       help
-         Enable CAN0/1 Wake-Up (Voltage Regulator Power-Up)
-
 config PM_BFIN_WAKE_GP
        bool "Allow Wake-Up from GPIOs"
        depends on PM && BF54x
        default n
        help
          Enable General-Purpose Wake-Up (Voltage Regulator Power-Up)
-
-config PM_BFIN_WAKE_USB
-       bool "Allow Wake-Up from on-chip USB"
-       depends on PM && (BF54x || BF52x)
-       default n
-       help
-         Enable USB Wake-Up (Voltage Regulator Power-Up)
-
-config PM_BFIN_WAKE_KEYPAD
-       bool "Allow Wake-Up from on-chip Keypad"
-       depends on PM && BF54x
-       default n
-       help
-         Enable Keypad Wake-Up (Voltage Regulator Power-Up)
-
-config PM_BFIN_WAKE_ROTARY
-       bool "Allow Wake-Up from on-chip Rotary"
-       depends on PM && BF54x
-       default n
-       help
-         Enable Rotary Wake-Up (Voltage Regulator Power-Up)
-
 endmenu
 
 menu "CPU Frequency scaling"
diff --git a/arch/blackfin/configs/BlackStamp_defconfig b/arch/blackfin/configs/BlackStamp_defconfig
new file mode 100644 (file)
index 0000000..2921f99
--- /dev/null
@@ -0,0 +1,1195 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.26.2
+#
+# CONFIG_MMU is not set
+# CONFIG_FPU is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+CONFIG_BLACKFIN=y
+CONFIG_ZONE_DMA=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_FORCE_MAX_ZONEORDER=14
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+# CONFIG_GROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_COMPAT_BRK=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_HAVE_KPROBES is not set
+# CONFIG_HAVE_KRETPROBES is not set
+# CONFIG_HAVE_DMA_ATTRS is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_TINY_SHMEM=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_PREEMPT_NONE is not set
+CONFIG_PREEMPT_VOLUNTARY=y
+# CONFIG_PREEMPT is not set
+
+#
+# Blackfin Processor Options
+#
+
+#
+# Processor and Board Settings
+#
+# CONFIG_BF522 is not set
+# CONFIG_BF523 is not set
+# CONFIG_BF524 is not set
+# CONFIG_BF525 is not set
+# CONFIG_BF526 is not set
+# CONFIG_BF527 is not set
+# CONFIG_BF531 is not set
+CONFIG_BF532=y
+# CONFIG_BF533 is not set
+# CONFIG_BF534 is not set
+# CONFIG_BF536 is not set
+# CONFIG_BF537 is not set
+# CONFIG_BF542 is not set
+# CONFIG_BF544 is not set
+# CONFIG_BF547 is not set
+# CONFIG_BF548 is not set
+# CONFIG_BF549 is not set
+# CONFIG_BF561 is not set
+# CONFIG_BF_REV_0_0 is not set
+# CONFIG_BF_REV_0_1 is not set
+# CONFIG_BF_REV_0_2 is not set
+# CONFIG_BF_REV_0_3 is not set
+# CONFIG_BF_REV_0_4 is not set
+CONFIG_BF_REV_0_5=y
+# CONFIG_BF_REV_ANY is not set
+# CONFIG_BF_REV_NONE is not set
+CONFIG_BF53x=y
+CONFIG_MEM_MT48LC32M16A2TG_75=y
+# CONFIG_BFIN533_EZKIT is not set
+# CONFIG_BFIN533_STAMP is not set
+# CONFIG_BFIN533_BLUETECHNIX_CM is not set
+# CONFIG_H8606_HVSISTEMAS is not set
+# CONFIG_BFIN532_IP0X is not set
+CONFIG_BLACKSTAMP=y
+# CONFIG_GENERIC_BF533_BOARD is not set
+
+#
+# BF533/2/1 Specific Configuration
+#
+
+#
+# Interrupt Priority Assignment
+#
+
+#
+# Priority
+#
+CONFIG_UART_ERROR=7
+CONFIG_SPORT0_ERROR=7
+CONFIG_SPI_ERROR=7
+CONFIG_SPORT1_ERROR=7
+CONFIG_PPI_ERROR=7
+CONFIG_DMA_ERROR=7
+CONFIG_PLLWAKE_ERROR=7
+CONFIG_RTC_ERROR=8
+CONFIG_DMA0_PPI=8
+CONFIG_DMA1_SPORT0RX=9
+CONFIG_DMA2_SPORT0TX=9
+CONFIG_DMA3_SPORT1RX=9
+CONFIG_DMA4_SPORT1TX=9
+CONFIG_DMA5_SPI=10
+CONFIG_DMA6_UARTRX=10
+CONFIG_DMA7_UARTTX=10
+CONFIG_TIMER0=11
+CONFIG_TIMER1=11
+CONFIG_TIMER2=11
+CONFIG_PFA=12
+CONFIG_PFB=12
+CONFIG_MEMDMA0=13
+CONFIG_MEMDMA1=13
+CONFIG_WDTIMER=13
+
+#
+# Board customizations
+#
+# CONFIG_CMDLINE_BOOL is not set
+CONFIG_BOOT_LOAD=0x1000
+
+#
+# Clock/PLL Setup
+#
+CONFIG_CLKIN_HZ=25000000
+# CONFIG_BFIN_KERNEL_CLOCK is not set
+# CONFIG_PLL_BYPASS is not set
+# CONFIG_CLKIN_HALF is not set
+CONFIG_VCO_MULT=16
+CONFIG_CCLK_DIV_1=y
+# CONFIG_CCLK_DIV_2 is not set
+# CONFIG_CCLK_DIV_4 is not set
+# CONFIG_CCLK_DIV_8 is not set
+CONFIG_SCLK_DIV=3
+CONFIG_MAX_MEM_SIZE=64
+CONFIG_MAX_VCO_HZ=400000000
+CONFIG_MIN_VCO_HZ=50000000
+CONFIG_MAX_SCLK_HZ=133333333
+CONFIG_MIN_SCLK_HZ=27000000
+
+#
+# Kernel Timer/Scheduler
+#
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+# CONFIG_SCHED_HRTICK is not set
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+# CONFIG_CYCLES_CLOCKSOURCE is not set
+CONFIG_TICK_ONESHOT=y
+# CONFIG_NO_HZ is not set
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+
+#
+# Memory Setup
+#
+
+#
+# Misc
+#
+CONFIG_BFIN_SCRATCH_REG_RETN=y
+# CONFIG_BFIN_SCRATCH_REG_RETE is not set
+# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set
+
+#
+# Blackfin Kernel Optimizations
+#
+
+#
+# Memory Optimizations
+#
+CONFIG_I_ENTRY_L1=y
+CONFIG_EXCPT_IRQ_SYSC_L1=y
+CONFIG_DO_IRQ_L1=y
+CONFIG_CORE_TIMER_IRQ_L1=y
+CONFIG_IDLE_L1=y
+CONFIG_SCHEDULE_L1=y
+CONFIG_ARITHMETIC_OPS_L1=y
+CONFIG_ACCESS_OK_L1=y
+CONFIG_MEMSET_L1=y
+CONFIG_MEMCPY_L1=y
+CONFIG_SYS_BFIN_SPINLOCK_L1=y
+# CONFIG_IP_CHECKSUM_L1 is not set
+CONFIG_CACHELINE_ALIGNED_L1=y
+# CONFIG_SYSCALL_TAB_L1 is not set
+# CONFIG_CPLB_SWITCH_TAB_L1 is not set
+# CONFIG_RAMKERNEL is not set
+CONFIG_ROMKERNEL=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_VIRT_TO_BUS=y
+CONFIG_BFIN_GPTIMERS=y
+CONFIG_BFIN_DMA_5XX=y
+# CONFIG_DMA_UNCACHED_4M is not set
+# CONFIG_DMA_UNCACHED_2M is not set
+CONFIG_DMA_UNCACHED_1M=y
+# CONFIG_DMA_UNCACHED_NONE is not set
+
+#
+# Cache Support
+#
+CONFIG_BFIN_ICACHE=y
+CONFIG_BFIN_DCACHE=y
+# CONFIG_BFIN_DCACHE_BANKA is not set
+# CONFIG_BFIN_ICACHE_LOCK is not set
+# CONFIG_BFIN_WB is not set
+CONFIG_BFIN_WT=y
+# CONFIG_MPU is not set
+
+#
+# Asynchonous Memory Configuration
+#
+
+#
+# EBIU_AMGCTL Global Control
+#
+CONFIG_C_AMCKEN=y
+CONFIG_C_CDPRIO=y
+# CONFIG_C_AMBEN is not set
+# CONFIG_C_AMBEN_B0 is not set
+# CONFIG_C_AMBEN_B0_B1 is not set
+# CONFIG_C_AMBEN_B0_B1_B2 is not set
+CONFIG_C_AMBEN_ALL=y
+
+#
+# EBIU_AMBCTL Control
+#
+CONFIG_BANK_0=0x7BB0
+CONFIG_BANK_1=0x7BB0
+CONFIG_BANK_2=0x7BB0
+CONFIG_BANK_3=0xAAC2
+
+#
+# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
+#
+# CONFIG_PCI is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF_FDPIC=y
+CONFIG_BINFMT_FLAT=y
+CONFIG_BINFMT_ZFLAT=y
+CONFIG_BINFMT_SHARED_FLAT=y
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_PM_BFIN_SLEEP_DEEPER=y
+# CONFIG_PM_BFIN_SLEEP is not set
+# CONFIG_PM_WAKEUP_BY_GPIO is not set
+
+#
+# Possible Suspend Mem / Hibernate Wake-Up Sources
+#
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETLABEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=m
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=m
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=m
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CFI_AMDSTD=m
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=m
+CONFIG_MTD_RAM=y
+CONFIG_MTD_ROM=m
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_GPIO_ADDR is not set
+# CONFIG_MTD_UCLINUX is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+CONFIG_MTD_M25P80=y
+# CONFIG_M25PXX_USE_FAST_READ is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+CONFIG_BLK_DEV_NBD=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+CONFIG_SMC91X=y
+# CONFIG_SMSC911X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_ENC28J60 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_B44 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+# CONFIG_WAN is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=m
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_AD9960 is not set
+# CONFIG_SPI_ADC_BF533 is not set
+# CONFIG_BF5xx_PPIFCD is not set
+# CONFIG_BFIN_SIMPLE_TIMER is not set
+CONFIG_BF5xx_PPI=y
+CONFIG_BFIN_SPORT=y
+# CONFIG_BFIN_TIMER_LATENCY is not set
+# CONFIG_TWI_LCD is not set
+CONFIG_SIMPLE_GPIO=m
+# CONFIG_VT is not set
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_BFIN=y
+CONFIG_SERIAL_BFIN_CONSOLE=y
+CONFIG_SERIAL_BFIN_DMA=y
+# CONFIG_SERIAL_BFIN_PIO is not set
+CONFIG_SERIAL_BFIN_UART0=y
+# CONFIG_BFIN_UART0_CTSRTS is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_BFIN_SPORT is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+
+#
+# CAN, the car bus and industrial fieldbus
+#
+# CONFIG_CAN4LINUX is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_I2C=m
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=m
+CONFIG_I2C_ALGOBIT=m
+
+#
+# I2C Hardware Bus support
+#
+CONFIG_I2C_GPIO=m
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_AD5252 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BFIN=y
+# CONFIG_SPI_BITBANG is not set
+
+#
+# SPI Protocol Masters
+#
+CONFIG_SPI_AT25=y
+CONFIG_SPI_SPIDEV=m
+# CONFIG_SPI_TLE62X0 is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1029 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7473 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM70 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_LM93 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_MAX6650 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_DME1737 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_ADS7828 is not set
+# CONFIG_SENSORS_THMC50 is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83L786NG is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_THERMAL is not set
+# CONFIG_THERMAL_HWMON is not set
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_BFIN_WDT=y
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD Host Controller Drivers
+#
+CONFIG_MMC_SPI=y
+# CONFIG_SPI_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_R9701 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_BFIN=y
+# CONFIG_UIO is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_DNOTIFY is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+# CONFIG_TMPFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_YAFFS_FS=m
+CONFIG_YAFFS_YAFFS1=y
+# CONFIG_YAFFS_9BYTE_TAGS is not set
+# CONFIG_YAFFS_DOES_ECC is not set
+CONFIG_YAFFS_YAFFS2=y
+CONFIG_YAFFS_AUTO_YAFFS2=y
+# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
+# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
+# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
+CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+# CONFIG_NFSD is not set
+# CONFIG_ROOT_NFS is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_BIND34 is not set
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+CONFIG_SMB_FS=y
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=y
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+CONFIG_NLS_ASCII=y
+# CONFIG_NLS_ISO8859_1 is not set
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=y
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_SAMPLES is not set
+CONFIG_DEBUG_MMRS=y
+CONFIG_DEBUG_HUNT_FOR_ZERO=y
+CONFIG_DEBUG_BFIN_HWTRACE_ON=y
+CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
+# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set
+# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
+CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0
+# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
+# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
+CONFIG_EARLY_PRINTK=y
+CONFIG_CPLB_INFO=y
+CONFIG_ACCESS_CHECK=y
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+CONFIG_SECURITY=y
+# CONFIG_SECURITY_NETWORK is not set
+# CONFIG_SECURITY_CAPABILITIES is not set
+CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_MANAGER=y
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_LZO is not set
+CONFIG_CRYPTO_HW=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_GENERIC_FIND_FIRST_BIT is not set
+CONFIG_CRC_CCITT=m
+# CONFIG_CRC16 is not set
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+CONFIG_CRC7=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/TCM-BF537_defconfig b/arch/blackfin/configs/TCM-BF537_defconfig
new file mode 100644 (file)
index 0000000..c482ee1
--- /dev/null
@@ -0,0 +1,693 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.24.7
+# Thu Jul 31 00:53:15 2008
+#
+# CONFIG_MMU is not set
+# CONFIG_FPU is not set
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+CONFIG_BLACKFIN=y
+CONFIG_ZONE_DMA=y
+CONFIG_SEMAPHORE_SLEEPERS=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_FORCE_MAX_ZONEORDER=14
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+# CONFIG_BLK_DEV_INITRD is not set
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+# CONFIG_UID16 is not set
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+# CONFIG_HOTPLUG is not set
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_TINY_SHMEM=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_AS is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+CONFIG_DEFAULT_NOOP=y
+CONFIG_DEFAULT_IOSCHED="noop"
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+
+#
+# Blackfin Processor Options
+#
+
+#
+# Processor and Board Settings
+#
+# CONFIG_BF522 is not set
+# CONFIG_BF523 is not set
+# CONFIG_BF524 is not set
+# CONFIG_BF525 is not set
+# CONFIG_BF526 is not set
+# CONFIG_BF527 is not set
+# CONFIG_BF531 is not set
+# CONFIG_BF532 is not set
+# CONFIG_BF533 is not set
+# CONFIG_BF534 is not set
+# CONFIG_BF536 is not set
+CONFIG_BF537=y
+# CONFIG_BF542 is not set
+# CONFIG_BF544 is not set
+# CONFIG_BF547 is not set
+# CONFIG_BF548 is not set
+# CONFIG_BF549 is not set
+# CONFIG_BF561 is not set
+# CONFIG_BF_REV_0_0 is not set
+# CONFIG_BF_REV_0_1 is not set
+CONFIG_BF_REV_0_2=y
+# CONFIG_BF_REV_0_3 is not set
+# CONFIG_BF_REV_0_4 is not set
+# CONFIG_BF_REV_0_5 is not set
+# CONFIG_BF_REV_ANY is not set
+# CONFIG_BF_REV_NONE is not set
+CONFIG_BF53x=y
+CONFIG_IRQ_PLL_WAKEUP=7
+CONFIG_IRQ_RTC=8
+CONFIG_IRQ_PPI=8
+CONFIG_IRQ_SPORT0_RX=9
+CONFIG_IRQ_SPORT0_TX=9
+CONFIG_IRQ_SPORT1_RX=9
+CONFIG_IRQ_SPORT1_TX=9
+CONFIG_IRQ_TWI=10
+CONFIG_IRQ_SPI=10
+CONFIG_IRQ_UART0_RX=10
+CONFIG_IRQ_UART0_TX=10
+CONFIG_IRQ_UART1_RX=10
+CONFIG_IRQ_UART1_TX=10
+CONFIG_IRQ_MAC_RX=11
+CONFIG_IRQ_MAC_TX=11
+CONFIG_IRQ_TMR0=12
+CONFIG_IRQ_TMR1=12
+CONFIG_IRQ_TMR2=12
+CONFIG_IRQ_TMR3=12
+CONFIG_IRQ_TMR4=12
+CONFIG_IRQ_TMR5=12
+CONFIG_IRQ_TMR6=12
+CONFIG_IRQ_TMR7=12
+CONFIG_IRQ_PORTG_INTB=12
+CONFIG_IRQ_MEM_DMA0=13
+CONFIG_IRQ_MEM_DMA1=13
+CONFIG_IRQ_WATCH=13
+# CONFIG_BFIN537_STAMP is not set
+# CONFIG_BFIN537_BLUETECHNIX_CM is not set
+CONFIG_BFIN537_BLUETECHNIX_TCM=y
+# CONFIG_PNAV10 is not set
+# CONFIG_CAMSIG_MINOTAUR is not set
+# CONFIG_GENERIC_BF537_BOARD is not set
+
+#
+# BF537 Specific Configuration
+#
+
+#
+# Interrupt Priority Assignment
+#
+
+#
+# Priority
+#
+CONFIG_IRQ_DMA_ERROR=7
+CONFIG_IRQ_ERROR=7
+CONFIG_IRQ_CAN_RX=11
+CONFIG_IRQ_CAN_TX=11
+CONFIG_IRQ_PROG_INTA=12
+
+#
+# Board customizations
+#
+# CONFIG_CMDLINE_BOOL is not set
+CONFIG_BOOT_LOAD=0x1000
+
+#
+# Clock/PLL Setup
+#
+CONFIG_CLKIN_HZ=25000000
+# CONFIG_BFIN_KERNEL_CLOCK is not set
+CONFIG_MAX_MEM_SIZE=32
+CONFIG_MAX_VCO_HZ=600000000
+CONFIG_MIN_VCO_HZ=50000000
+CONFIG_MAX_SCLK_HZ=133333333
+CONFIG_MIN_SCLK_HZ=27000000
+
+#
+# Kernel Timer/Scheduler
+#
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+# CONFIG_CYCLES_CLOCKSOURCE is not set
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+
+#
+# Misc
+#
+CONFIG_BFIN_SCRATCH_REG_RETN=y
+# CONFIG_BFIN_SCRATCH_REG_RETE is not set
+# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set
+
+#
+# Blackfin Kernel Optimizations
+#
+
+#
+# Memory Optimizations
+#
+CONFIG_I_ENTRY_L1=y
+CONFIG_EXCPT_IRQ_SYSC_L1=y
+CONFIG_DO_IRQ_L1=y
+CONFIG_CORE_TIMER_IRQ_L1=y
+CONFIG_IDLE_L1=y
+CONFIG_SCHEDULE_L1=y
+CONFIG_ARITHMETIC_OPS_L1=y
+CONFIG_ACCESS_OK_L1=y
+CONFIG_MEMSET_L1=y
+CONFIG_MEMCPY_L1=y
+CONFIG_SYS_BFIN_SPINLOCK_L1=y
+CONFIG_IP_CHECKSUM_L1=y
+CONFIG_CACHELINE_ALIGNED_L1=y
+CONFIG_SYSCALL_TAB_L1=y
+CONFIG_CPLB_SWITCH_TAB_L1=y
+CONFIG_RAMKERNEL=y
+# CONFIG_ROMKERNEL is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_BFIN_GPTIMERS is not set
+CONFIG_BFIN_DMA_5XX=y
+# CONFIG_DMA_UNCACHED_4M is not set
+# CONFIG_DMA_UNCACHED_2M is not set
+CONFIG_DMA_UNCACHED_1M=y
+# CONFIG_DMA_UNCACHED_NONE is not set
+
+#
+# Cache Support
+#
+CONFIG_BFIN_ICACHE=y
+CONFIG_BFIN_DCACHE=y
+# CONFIG_BFIN_DCACHE_BANKA is not set
+# CONFIG_BFIN_ICACHE_LOCK is not set
+CONFIG_BFIN_WB=y
+# CONFIG_BFIN_WT is not set
+# CONFIG_MPU is not set
+
+#
+# Asynchonous Memory Configuration
+#
+
+#
+# EBIU_AMGCTL Global Control
+#
+CONFIG_C_AMCKEN=y
+CONFIG_C_CDPRIO=y
+# CONFIG_C_AMBEN is not set
+# CONFIG_C_AMBEN_B0 is not set
+# CONFIG_C_AMBEN_B0_B1 is not set
+# CONFIG_C_AMBEN_B0_B1_B2 is not set
+CONFIG_C_AMBEN_ALL=y
+
+#
+# EBIU_AMBCTL Control
+#
+CONFIG_BANK_0=0x7BB0
+CONFIG_BANK_1=0x7BB0
+CONFIG_BANK_2=0x7BB0
+CONFIG_BANK_3=0xFFC2
+
+#
+# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
+#
+# CONFIG_PCI is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+
+#
+# Executable file formats
+#
+CONFIG_BINFMT_ELF_FDPIC=y
+CONFIG_BINFMT_FLAT=y
+CONFIG_BINFMT_ZFLAT=y
+CONFIG_BINFMT_SHARED_FLAT=y
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+# CONFIG_PM is not set
+CONFIG_SUSPEND_UP_POSSIBLE=y
+# CONFIG_PM_WAKEUP_BY_GPIO is not set
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
+
+#
+# Networking
+#
+# CONFIG_NET is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_CONCAT is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_RAM=y
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_GPIO_ADDR is not set
+CONFIG_MTD_UCLINUX=y
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_CDROM_PKTCDVD is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+# CONFIG_INPUT is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_AD9960 is not set
+# CONFIG_SPI_ADC_BF533 is not set
+# CONFIG_BF5xx_PPIFCD is not set
+# CONFIG_BFIN_SIMPLE_TIMER is not set
+# CONFIG_BF5xx_PPI is not set
+CONFIG_BFIN_SPORT=y
+# CONFIG_BFIN_TIMER_LATENCY is not set
+# CONFIG_SIMPLE_GPIO is not set
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_BFIN=y
+CONFIG_SERIAL_BFIN_CONSOLE=y
+CONFIG_SERIAL_BFIN_DMA=y
+# CONFIG_SERIAL_BFIN_PIO is not set
+CONFIG_SERIAL_BFIN_UART0=y
+# CONFIG_BFIN_UART0_CTSRTS is not set
+CONFIG_SERIAL_BFIN_UART1=y
+# CONFIG_BFIN_UART1_CTSRTS is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_BFIN_SPORT is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+
+#
+# CAN, the car bus and industrial fieldbus
+#
+# CONFIG_CAN4LINUX is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BFIN=y
+# CONFIG_SPI_BITBANG is not set
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_AT25 is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+# CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_BFIN_WDT=y
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_MMC is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_RTC_CLASS is not set
+
+#
+# Userspace I/O
+#
+# CONFIG_UIO is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+# CONFIG_EXT2_FS_POSIX_ACL is not set
+# CONFIG_EXT2_FS_SECURITY is not set
+# CONFIG_EXT3_FS is not set
+# CONFIG_EXT4DEV_FS is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+# CONFIG_TMPFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_YAFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_NLS is not set
+# CONFIG_INSTRUMENTATION is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_SAMPLES is not set
+CONFIG_DEBUG_MMRS=y
+CONFIG_DEBUG_HUNT_FOR_ZERO=y
+CONFIG_DEBUG_BFIN_HWTRACE_ON=y
+CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
+# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set
+# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
+CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0
+# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
+# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
+# CONFIG_EARLY_PRINTK is not set
+CONFIG_CPLB_INFO=y
+CONFIG_ACCESS_CHECK=y
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+CONFIG_SECURITY=y
+# CONFIG_SECURITY_NETWORK is not set
+CONFIG_SECURITY_CAPABILITIES=y
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+# CONFIG_CRYPTO is not set
+
+#
+# Library routines
+#
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+# CONFIG_CRC32 is not set
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
index 9eecfa4..a8b712a 100644 (file)
@@ -25,7 +25,7 @@
 #include <asm/cplbinit.h>
 
 #if defined(CONFIG_BFIN_ICACHE)
-void bfin_icache_init(void)
+void __init bfin_icache_init(void)
 {
        unsigned long ctrl;
        int i;
@@ -43,7 +43,7 @@ void bfin_icache_init(void)
 #endif
 
 #if defined(CONFIG_BFIN_DCACHE)
-void bfin_dcache_init(void)
+void __init bfin_dcache_init(void)
 {
        unsigned long ctrl;
        int i;
index 8a18399..bd08315 100644 (file)
@@ -25,7 +25,7 @@
 #include <asm/cplbinit.h>
 
 #if defined(CONFIG_BFIN_ICACHE)
-void bfin_icache_init(void)
+void __init bfin_icache_init(void)
 {
        unsigned long *table = icplb_table;
        unsigned long ctrl;
@@ -47,7 +47,7 @@ void bfin_icache_init(void)
 #endif
 
 #if defined(CONFIG_BFIN_DCACHE)
-void bfin_dcache_init(void)
+void __init bfin_dcache_init(void)
 {
        unsigned long *table = dcplb_table;
        unsigned long ctrl;
index 224e7cc..728f708 100644 (file)
@@ -164,17 +164,13 @@ static struct cplb_desc cplb_data[] = {
                .name = "Asynchronous Memory Banks",
        },
        {
-#ifdef L2_START
                .start = L2_START,
                .end = L2_START + L2_LENGTH,
                .psize = SIZE_1M,
                .attr = SWITCH_T | I_CPLB | D_CPLB,
                .i_conf = L2_MEMORY,
                .d_conf = L2_MEMORY,
-               .valid = 1,
-#else
-               .valid = 0,
-#endif
+               .valid = (L2_LENGTH > 0),
                .name = "L2 Memory",
        },
        {
index 23e637e..7a82d10 100644 (file)
@@ -52,6 +52,7 @@ EXPORT_SYMBOL(mtd_size);
 #endif
 
 char __initdata command_line[COMMAND_LINE_SIZE];
+unsigned int __initdata *__retx;
 
 /* boot memmap, for parsing "memmap=" */
 #define BFIN_MEMMAP_MAX                128 /* number of entries in bfin_memmap */
@@ -131,14 +132,14 @@ void __init bf53x_relocate_l1_mem(void)
        dma_memcpy(_sdata_b_l1, _l1_lma_start + l1_code_length +
                        l1_data_a_length, l1_data_b_length);
 
-#ifdef L2_LENGTH
-       l2_length = _ebss_l2 - _stext_l2;
-       if (l2_length > L2_LENGTH)
-               panic("L2 SRAM Overflow\n");
+       if (L2_LENGTH != 0) {
+               l2_length = _ebss_l2 - _stext_l2;
+               if (l2_length > L2_LENGTH)
+                       panic("L2 SRAM Overflow\n");
 
-       /* Copy _stext_l2 to _edata_l2 to L2 SRAM */
-       dma_memcpy(_stext_l2, _l2_lma_start, l2_length);
-#endif
+               /* Copy _stext_l2 to _edata_l2 to L2 SRAM */
+               dma_memcpy(_stext_l2, _l2_lma_start, l2_length);
+       }
 }
 
 /* add_memory_region to memmap */
@@ -738,6 +739,16 @@ void __init setup_arch(char **cmdline_p)
 
        memory_setup();
 
+       /* Initialize Async memory banks */
+       bfin_write_EBIU_AMBCTL0(AMBCTL0VAL);
+       bfin_write_EBIU_AMBCTL1(AMBCTL1VAL);
+       bfin_write_EBIU_AMGCTL(AMGCTLVAL);
+#ifdef CONFIG_EBIU_MBSCTLVAL
+       bfin_write_EBIU_MBSCTL(CONFIG_EBIU_MBSCTLVAL);
+       bfin_write_EBIU_MODE(CONFIG_EBIU_MODEVAL);
+       bfin_write_EBIU_FCTL(CONFIG_EBIU_FCTLVAL);
+#endif
+
        cclk = get_cclk();
        sclk = get_sclk();
 
@@ -775,7 +786,11 @@ void __init setup_arch(char **cmdline_p)
        bfin_write_SWRST(DOUBLE_FAULT);
 
        if (_bfin_swrst & RESET_DOUBLE)
-               printk(KERN_INFO "Recovering from Double Fault event\n");
+               /*
+                * don't decode the address, since you don't know if this
+                * kernel's symbol map is the same as the crashing kernel
+                */
+               printk(KERN_INFO "Recovering from Double Fault event at %pF\n", __retx);
        else if (_bfin_swrst & RESET_WDOG)
                printk(KERN_INFO "Recovering from Watchdog event\n");
        else if (_bfin_swrst & RESET_SOFTWARE)
@@ -1049,7 +1064,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                   dsup_banks, BFIN_DSUBBANKS, BFIN_DWAYS,
                   BFIN_DLINES);
 #ifdef CONFIG_BFIN_ICACHE_LOCK
-       switch (read_iloc()) {
+       switch ((bfin_read_IMEM_CONTROL() >> 3) & WAYALL_L) {
        case WAY0_L:
                seq_printf(m, "Way0 Locked-Down\n");
                break;
index ad922ab..9a9d508 100644 (file)
@@ -567,7 +567,7 @@ bool get_instruction(unsigned short *val, unsigned short *address)
         * we don't read something in the async space that can hang forever
         */
        if ((addr >= FIXED_CODE_START && (addr + 2) <= physical_mem_end) ||
-#ifdef L2_START
+#if L2_LENGTH != 0
            (addr >= L2_START && (addr + 2) <= (L2_START + L2_LENGTH)) ||
 #endif
            (addr >= BOOT_ROM_START && (addr + 2) <= (BOOT_ROM_START + BOOT_ROM_LENGTH)) ||
@@ -601,12 +601,55 @@ bool get_instruction(unsigned short *val, unsigned short *address)
        return false;
 }
 
+/* 
+ * decode the instruction if we are printing out the trace, as it
+ * makes things easier to follow, without running it through objdump
+ * These are the normal instructions which cause change of flow, which
+ * would be at the source of the trace buffer
+ */
+void decode_instruction(unsigned short *address)
+{
+       unsigned short opcode;
+
+       if (get_instruction(&opcode, address)) {
+               if (opcode == 0x0010)
+                       printk("RTS");
+               else if (opcode == 0x0011)
+                       printk("RTI");
+               else if (opcode == 0x0012)
+                       printk("RTX");
+               else if (opcode >= 0x0050 && opcode <= 0x0057)
+                       printk("JUMP (P%i)", opcode & 7);
+               else if (opcode >= 0x0060 && opcode <= 0x0067)
+                       printk("CALL (P%i)", opcode & 7);
+               else if (opcode >= 0x0070 && opcode <= 0x0077)
+                       printk("CALL (PC+P%i)", opcode & 7);
+               else if (opcode >= 0x0080 && opcode <= 0x0087)
+                       printk("JUMP (PC+P%i)", opcode & 7);
+               else if ((opcode >= 0x1000 && opcode <= 0x13FF) || (opcode >= 0x1800 && opcode <= 0x1BFF))
+                       printk("IF !CC JUMP");
+               else if ((opcode >= 0x1400 && opcode <= 0x17ff) || (opcode >= 0x1c00 && opcode <= 0x1fff))
+                       printk("IF CC JUMP");
+               else if (opcode >= 0x2000 && opcode <= 0x2fff)
+                       printk("JUMP.S");
+               else if (opcode >= 0xe080 && opcode <= 0xe0ff)
+                       printk("LSETUP");
+               else if (opcode >= 0xe200 && opcode <= 0xe2ff)
+                       printk("JUMP.L");
+               else if (opcode >= 0xe300 && opcode <= 0xe3ff)
+                       printk("CALL pcrel");
+               else
+                       printk("0x%04x", opcode);
+       }
+
+}
+
 void dump_bfin_trace_buffer(void)
 {
 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
        int tflags, i = 0;
        char buf[150];
-       unsigned short val = 0, *addr;
+       unsigned short *addr;
 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
        int j, index;
 #endif
@@ -615,6 +658,10 @@ void dump_bfin_trace_buffer(void)
 
        printk(KERN_NOTICE "Hardware Trace:\n");
 
+#ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
+       printk(KERN_NOTICE "WARNING: Expanded trace turned on - can not trace exceptions\n");
+#endif
+
        if (likely(bfin_read_TBUFSTAT() & TBUFCNT)) {
                for (; bfin_read_TBUFSTAT() & TBUFCNT; i++) {
                        decode_address(buf, (unsigned long)bfin_read_TBUF());
@@ -622,45 +669,14 @@ void dump_bfin_trace_buffer(void)
                        addr = (unsigned short *)bfin_read_TBUF();
                        decode_address(buf, (unsigned long)addr);
                        printk(KERN_NOTICE "     Source : %s ", buf);
-                       if (get_instruction(&val, addr)) {
-                               if (val == 0x0010)
-                                       printk("RTS");
-                               else if (val == 0x0011)
-                                       printk("RTI");
-                               else if (val == 0x0012)
-                                       printk("RTX");
-                               else if (val >= 0x0050 && val <= 0x0057)
-                                       printk("JUMP (P%i)", val & 7);
-                               else if (val >= 0x0060 && val <= 0x0067)
-                                       printk("CALL (P%i)", val & 7);
-                               else if (val >= 0x0070 && val <= 0x0077)
-                                       printk("CALL (PC+P%i)", val & 7);
-                               else if (val >= 0x0080 && val <= 0x0087)
-                                       printk("JUMP (PC+P%i)", val & 7);
-                               else if ((val >= 0x1000 && val <= 0x13FF) ||
-                                   (val >= 0x1800 && val <= 0x1BFF))
-                                       printk("IF !CC JUMP");
-                               else if ((val >= 0x1400 && val <= 0x17ff) ||
-                                   (val >= 0x1c00 && val <= 0x1fff))
-                                       printk("IF CC JUMP");
-                               else if (val >= 0x2000 && val <= 0x2fff)
-                                       printk("JUMP.S");
-                               else if (val >= 0xe080 && val <= 0xe0ff)
-                                       printk("LSETUP");
-                               else if (val >= 0xe200 && val <= 0xe2ff)
-                                       printk("JUMP.L");
-                               else if (val >= 0xe300 && val <= 0xe3ff)
-                                       printk("CALL pcrel");
-                               else
-                                       printk("0x%04x", val);
-                       }
+                       decode_instruction(addr);
                        printk("\n");
                }
        }
 
 #ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
        if (trace_buff_offset)
-               index = trace_buff_offset/4 - 1;
+               index = trace_buff_offset / 4;
        else
                index = EXPAND_LEN;
 
@@ -672,7 +688,9 @@ void dump_bfin_trace_buffer(void)
                if (index < 0 )
                        index = EXPAND_LEN;
                decode_address(buf, software_trace_buff[index]);
-               printk(KERN_NOTICE "     Source : %s\n", buf);
+               printk(KERN_NOTICE "     Source : %s ", buf);
+               decode_instruction((unsigned short *)software_trace_buff[index]);
+               printk("\n");
                index -= 1;
                if (index < 0)
                        index = EXPAND_LEN;
index 0896e38..7d12c66 100644 (file)
@@ -83,6 +83,7 @@ SECTIONS
 #if !L1_DATA_B_LENGTH
                *(.l1.bss.B)
 #endif
+               . = ALIGN(4);
                ___bss_stop = .;
        }
 
@@ -101,7 +102,7 @@ SECTIONS
 #if !L1_DATA_B_LENGTH
                *(.l1.data.B)
 #endif
-#ifndef L2_LENGTH
+#if !L2_LENGTH
                . = ALIGN(32);
                *(.data_l2.cacheline_aligned)
                *(.l2.data)
@@ -211,20 +212,19 @@ SECTIONS
                __ebss_b_l1 = .;
        }
 
-#ifdef L2_LENGTH
        __l2_lma_start = .;
 
        .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
        {
                . = ALIGN(4);
                __stext_l2 = .;
-               *(.l1.text)
+               *(.l2.text)
                . = ALIGN(4);
                __etext_l2 = .;
 
                . = ALIGN(4);
                __sdata_l2 = .;
-               *(.l1.data)
+               *(.l2.data)
                __edata_l2 = .;
 
                . = ALIGN(32);
@@ -232,11 +232,10 @@ SECTIONS
 
                . = ALIGN(4);
                __sbss_l2 = .;
-               *(.l1.bss)
+               *(.l2.bss)
                . = ALIGN(4);
                __ebss_l2 = .;
        }
-#endif
 
        /* Force trailing alignment of our init section so that when we
         * free our init memory, we don't leave behind a partial page.
index eba2343..d60554d 100644 (file)
 
 .align 2
 
+/*
+ * Reads on the Blackfin are speculative. In Blackfin terms, this means they
+ * can be interrupted at any time (even after they have been issued on to the
+ * external bus), and re-issued after the interrupt occurs.
+ *
+ * If a FIFO is sitting on the end of the read, it will see two reads,
+ * when the core only sees one. The FIFO receives the read which is cancelled,
+ * and not delivered to the core.
+ *
+ * To solve this, interrupts are turned off before reads occur to I/O space.
+ * There are 3 versions of all these functions
+ *  - turns interrupts off every read (higher overhead, but lower latency)
+ *  - turns interrupts off every loop (low overhead, but longer latency)
+ *  - DMA version, which do not suffer from this issue. DMA versions have
+ *      different name (prefixed by dma_ ), and are located in
+ *      ../kernel/bfin_dma_5xx.c
+ * Using the dma related functions are recommended for transfering large
+ * buffers in/out of FIFOs.
+ */
+
 ENTRY(_insl)
+#ifdef CONFIG_BFIN_INS_LOWOVERHEAD
        P0 = R0;        /* P0 = port */
        cli R3;
        P1 = R1;        /* P1 = address */
@@ -46,9 +67,26 @@ ENTRY(_insl)
 .Llong_loop_e:         NOP;
        sti R3;
        RTS;
+#else
+       P0 = R0;        /* P0 = port */
+       P1 = R1;        /* P1 = address */
+       P2 = R2;        /* P2 = count */
+       SSYNC;
+       LSETUP( .Llong_loop_s, .Llong_loop_e) LC0 = P2;
+.Llong_loop_s:
+       CLI R3;
+       NOP; NOP; NOP;
+       R0 = [P0];
+       [P1++] = R0;
+.Llong_loop_e:
+       STI R3;
+
+       RTS;
+#endif
 ENDPROC(_insl)
 
 ENTRY(_insw)
+#ifdef CONFIG_BFIN_INS_LOWOVERHEAD
        P0 = R0;        /* P0 = port */
        cli R3;
        P1 = R1;        /* P1 = address */
@@ -61,9 +99,26 @@ ENTRY(_insw)
 .Lword_loop_e:         NOP;
        sti R3;
        RTS;
+#else
+       P0 = R0;        /* P0 = port */
+       P1 = R1;        /* P1 = address */
+       P2 = R2;        /* P2 = count */
+       SSYNC;
+       LSETUP( .Lword_loop_s, .Lword_loop_e) LC0 = P2;
+.Lword_loop_s:
+       CLI R3;
+       NOP; NOP; NOP;
+       R0 = W[P0];
+       W[P1++] = R0;
+.Lword_loop_e:
+       STI R3;
+       RTS;
+
+#endif
 ENDPROC(_insw)
 
 ENTRY(_insw_8)
+#ifdef CONFIG_BFIN_INS_LOWOVERHEAD
        P0 = R0;        /* P0 = port */
        cli R3;
        P1 = R1;        /* P1 = address */
@@ -78,9 +133,29 @@ ENTRY(_insw_8)
 .Lword8_loop_e: NOP;
        sti R3;
        RTS;
+#else
+       P0 = R0;        /* P0 = port */
+       P1 = R1;        /* P1 = address */
+       P2 = R2;        /* P2 = count */
+       SSYNC;
+       LSETUP( .Lword8_loop_s, .Lword8_loop_e) LC0 = P2;
+.Lword8_loop_s:
+       CLI R3;
+       NOP; NOP; NOP;
+       R0 = W[P0];
+       B[P1++] = R0;
+       R0 = R0 >> 8;
+       B[P1++] = R0;
+       NOP;
+.Lword8_loop_e:
+       STI R3;
+
+       RTS;
+#endif
 ENDPROC(_insw_8)
 
 ENTRY(_insb)
+#ifdef CONFIG_BFIN_INS_LOWOVERHEAD
        P0 = R0;        /* P0 = port */
        cli R3;
        P1 = R1;        /* P1 = address */
@@ -93,9 +168,26 @@ ENTRY(_insb)
 .Lbyte_loop_e:  NOP;
        sti R3;
        RTS;
+#else
+       P0 = R0;        /* P0 = port */
+       P1 = R1;        /* P1 = address */
+       P2 = R2;        /* P2 = count */
+       SSYNC;
+       LSETUP( .Lbyte_loop_s, .Lbyte_loop_e) LC0 = P2;
+.Lbyte_loop_s:
+       CLI R3;
+       NOP; NOP; NOP;
+       R0 = B[P0];
+       B[P1++] = R0;
+.Lbyte_loop_e:
+       STI R3;
+
+       RTS;
+#endif
 ENDPROC(_insb)
 
 ENTRY(_insl_16)
+#ifdef CONFIG_BFIN_INS_LOWOVERHEAD
        P0 = R0;        /* P0 = port */
        cli R3;
        P1 = R1;        /* P1 = address */
@@ -110,4 +202,21 @@ ENTRY(_insl_16)
 .Llong16_loop_e:  NOP;
        sti R3;
        RTS;
+#else
+       P0 = R0;        /* P0 = port */
+       P1 = R1;        /* P1 = address */
+       P2 = R2;        /* P2 = count */
+       SSYNC;
+       LSETUP( .Llong16_loop_s, .Llong16_loop_e) LC0 = P2;
+.Llong16_loop_s:
+       CLI R3;
+       NOP; NOP; NOP;
+       R0 = [P0];
+       W[P1++] = R0;
+       R0 = R0 >> 16;
+       W[P1++] = R0;
+.Llong16_loop_e:
+       STI R3;
+       RTS;
+#endif
 ENDPROC(_insl_16)
index 0b26ae2..d22bc77 100644 (file)
@@ -39,7 +39,6 @@
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
 #include <linux/usb/isp1362.h>
 #endif
-#include <linux/pata_platform.h>
 #include <linux/i2c.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
@@ -160,15 +159,15 @@ static struct platform_device musb_device = {
 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
 static struct mtd_partition ezkit_partitions[] = {
        {
-               .name       = "Bootloader",
+               .name       = "bootloader(nor)",
                .size       = 0x40000,
                .offset     = 0,
        }, {
-               .name       = "Kernel",
+               .name       = "linux kernel(nor)",
                .size       = 0x1C0000,
                .offset     = MTDPART_OFS_APPEND,
        }, {
-               .name       = "RootFS",
+               .name       = "file system(nor)",
                .size       = MTDPART_SIZ_FULL,
                .offset     = MTDPART_OFS_APPEND,
        }
@@ -200,12 +199,12 @@ static struct platform_device ezkit_flash_device = {
 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
 static struct mtd_partition partition_info[] = {
        {
-               .name = "Linux Kernel",
+               .name = "linux kernel(nand)",
                .offset = 0,
                .size = 4 * SIZE_1M,
        },
        {
-               .name = "File System",
+               .name = "file system(nand)",
                .offset = MTDPART_OFS_APPEND,
                .size = MTDPART_SIZ_FULL,
        },
@@ -438,12 +437,12 @@ static struct platform_device net2272_bfin_device = {
        || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
-               .name = "bootloader",
+               .name = "bootloader(spi)",
                .size = 0x00040000,
                .offset = 0,
                .mask_flags = MTD_CAP_ROM
        }, {
-               .name = "linux kernel",
+               .name = "linux kernel(spi)",
                .size = MTDPART_SIZ_FULL,
                .offset = MTDPART_OFS_APPEND,
        }
@@ -799,43 +798,6 @@ static struct platform_device bfin_sport1_uart_device = {
 };
 #endif
 
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-#define PATA_INT       55
-
-static struct pata_platform_info bfin_pata_platform_data = {
-       .ioport_shift = 1,
-       .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
-};
-
-static struct resource bfin_pata_resources[] = {
-       {
-               .start = 0x20314020,
-               .end = 0x2031403F,
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .start = 0x2031401C,
-               .end = 0x2031401F,
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .start = PATA_INT,
-               .end = PATA_INT,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device bfin_pata_device = {
-       .name = "pata_platform",
-       .id = -1,
-       .num_resources = ARRAY_SIZE(bfin_pata_resources),
-       .resource = bfin_pata_resources,
-       .dev = {
-               .platform_data = &bfin_pata_platform_data,
-       }
-};
-#endif
-
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
@@ -961,10 +923,6 @@ static struct platform_device *stamp_devices[] __initdata = {
        &bfin_sport1_uart_device,
 #endif
 
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-       &bfin_pata_device,
-#endif
-
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
        &bfin_device_gpiokeys,
 #endif
@@ -987,10 +945,6 @@ static int __init stamp_init(void)
 
        platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
        spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
-
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-       irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
-#endif
        return 0;
 }
 
index 689b69c..762f754 100644 (file)
@@ -38,7 +38,6 @@
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
 #include <linux/usb/isp1362.h>
 #endif
-#include <linux/ata_platform.h>
 #include <linux/i2c.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
@@ -177,15 +176,15 @@ static struct platform_device bf52x_t350mcqb_device = {
 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
 static struct mtd_partition ezkit_partitions[] = {
        {
-               .name       = "Bootloader",
+               .name       = "bootloader(nor)",
                .size       = 0x40000,
                .offset     = 0,
        }, {
-               .name       = "Kernel",
+               .name       = "linux kernel(nor)",
                .size       = 0x1C0000,
                .offset     = MTDPART_OFS_APPEND,
        }, {
-               .name       = "RootFS",
+               .name       = "file system(nor)",
                .size       = MTDPART_SIZ_FULL,
                .offset     = MTDPART_OFS_APPEND,
        }
@@ -217,12 +216,12 @@ static struct platform_device ezkit_flash_device = {
 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
 static struct mtd_partition partition_info[] = {
        {
-               .name = "Linux Kernel",
+               .name = "linux kernel(nand)",
                .offset = 0,
                .size = 4 * SIZE_1M,
        },
        {
-               .name = "File System",
+               .name = "file system(nand)",
                .offset = MTDPART_OFS_APPEND,
                .size = MTDPART_SIZ_FULL,
        },
@@ -460,12 +459,12 @@ static struct platform_device net2272_bfin_device = {
        || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
-               .name = "bootloader",
+               .name = "bootloader(spi)",
                .size = 0x00040000,
                .offset = 0,
                .mask_flags = MTD_CAP_ROM
        }, {
-               .name = "linux kernel",
+               .name = "linux kernel(spi)",
                .size = MTDPART_SIZ_FULL,
                .offset = MTDPART_OFS_APPEND,
        }
@@ -825,43 +824,6 @@ static struct platform_device bfin_sport1_uart_device = {
 };
 #endif
 
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-#define PATA_INT       55
-
-static struct pata_platform_info bfin_pata_platform_data = {
-       .ioport_shift = 1,
-       .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
-};
-
-static struct resource bfin_pata_resources[] = {
-       {
-               .start = 0x20314020,
-               .end = 0x2031403F,
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .start = 0x2031401C,
-               .end = 0x2031401F,
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .start = PATA_INT,
-               .end = PATA_INT,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device bfin_pata_device = {
-       .name = "pata_platform",
-       .id = -1,
-       .num_resources = ARRAY_SIZE(bfin_pata_resources),
-       .resource = bfin_pata_resources,
-       .dev = {
-               .platform_data = &bfin_pata_platform_data,
-       }
-};
-#endif
-
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
@@ -996,10 +958,6 @@ static struct platform_device *stamp_devices[] __initdata = {
        &bfin_sport1_uart_device,
 #endif
 
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-       &bfin_pata_device,
-#endif
-
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
        &bfin_device_gpiokeys,
 #endif
@@ -1022,10 +980,6 @@ static int __init stamp_init(void)
 
        platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
        spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
-
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-       irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
-#endif
        return 0;
 }
 
index fe05cc1..c3334cc 100644 (file)
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <asm/blackfin.h>
-#include <asm/trace.h>
-
 #ifdef CONFIG_BFIN_KERNEL_CLOCK
 #include <asm/mach-common/clocks.h>
 #include <asm/mach/mem_init.h>
 #endif
 
-.extern ___bss_stop
-.extern ___bss_start
-.extern _bf53x_relocate_l1_mem
-
-#define INITIAL_STACK  0xFFB01000
-
-__INIT
-
-ENTRY(__start)
-       /* R0: argument of command line string, passed from uboot, save it */
-       R7 = R0;
-       /* Enable Cycle Counter and Nesting Of Interrupts */
-#ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES
-       R0 = SYSCFG_SNEN;
-#else
-       R0 = SYSCFG_SNEN | SYSCFG_CCEN;
-#endif
-       SYSCFG = R0;
-       R0 = 0;
-
-       /* Clear Out All the data and pointer Registers */
-       R1 = R0;
-       R2 = R0;
-       R3 = R0;
-       R4 = R0;
-       R5 = R0;
-       R6 = R0;
-
-       P0 = R0;
-       P1 = R0;
-       P2 = R0;
-       P3 = R0;
-       P4 = R0;
-       P5 = R0;
-
-       LC0 = r0;
-       LC1 = r0;
-       L0 = r0;
-       L1 = r0;
-       L2 = r0;
-       L3 = r0;
-
-       /* Clear Out All the DAG Registers */
-       B0 = r0;
-       B1 = r0;
-       B2 = r0;
-       B3 = r0;
-
-       I0 = r0;
-       I1 = r0;
-       I2 = r0;
-       I3 = r0;
-
-       M0 = r0;
-       M1 = r0;
-       M2 = r0;
-       M3 = r0;
-
-       trace_buffer_init(p0,r0);
-       P0 = R1;
-       R0 = R1;
-
-       /* Turn off the icache */
-       p0.l = LO(IMEM_CONTROL);
-       p0.h = HI(IMEM_CONTROL);
-       R1 = [p0];
-       R0 = ~ENICPLB;
-       R0 = R0 & R1;
-
-       /* Anomaly 05000125 */
-#if ANOMALY_05000125
-       CLI R2;
-       SSYNC;
-#endif
-       [p0] = R0;
-       SSYNC;
-#if ANOMALY_05000125
-       STI R2;
-#endif
-
-       /* Turn off the dcache */
-       p0.l = LO(DMEM_CONTROL);
-       p0.h = HI(DMEM_CONTROL);
-       R1 = [p0];
-       R0 = ~ENDCPLB;
-       R0 = R0 & R1;
-
-       /* Anomaly 05000125 */
-#if ANOMALY_05000125
-       CLI R2;
-       SSYNC;
-#endif
-       [p0] = R0;
-       SSYNC;
-#if ANOMALY_05000125
-       STI R2;
-#endif
-
-
-#if defined(CONFIG_BF527)
-       p0.h = hi(EMAC_SYSTAT);
-       p0.l = lo(EMAC_SYSTAT);
-       R0.h = 0xFFFF; /* Clear EMAC Interrupt Status bits */
-       R0.l = 0xFFFF;
-       [P0] = R0;
-       SSYNC;
-#endif
-
-       /* Initialise UART - when booting from u-boot, the UART is not disabled
-        * so if we dont initalize here, our serial console gets hosed */
-       p0.h = hi(UART1_LCR);
-       p0.l = lo(UART1_LCR);
-       r0 = 0x0(Z);
-       w[p0] = r0.L;   /* To enable DLL writes */
-       ssync;
-
-       p0.h = hi(UART1_DLL);
-       p0.l = lo(UART1_DLL);
-       r0 = 0x0(Z);
-       w[p0] = r0.L;
-       ssync;
-
-       p0.h = hi(UART1_DLH);
-       p0.l = lo(UART1_DLH);
-       r0 = 0x00(Z);
-       w[p0] = r0.L;
-       ssync;
-
-       p0.h = hi(UART1_GCTL);
-       p0.l = lo(UART1_GCTL);
-       r0 = 0x0(Z);
-       w[p0] = r0.L;   /* To enable UART clock */
-       ssync;
-
-       /* Initialize stack pointer */
-       sp.l = lo(INITIAL_STACK);
-       sp.h = hi(INITIAL_STACK);
-       fp = sp;
-       usp = sp;
-
-#ifdef CONFIG_EARLY_PRINTK
-       SP += -12;
-       call _init_early_exception_vectors;
-       SP += 12;
-#endif
-
-       /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
-       call _bf53x_relocate_l1_mem;
-#ifdef CONFIG_BFIN_KERNEL_CLOCK
-       call _start_dma_code;
-#endif
-
-       /* Code for initializing Async memory banks */
-
-       p2.h = hi(EBIU_AMBCTL1);
-       p2.l = lo(EBIU_AMBCTL1);
-       r0.h = hi(AMBCTL1VAL);
-       r0.l = lo(AMBCTL1VAL);
-       [p2] = r0;
-       ssync;
-
-       p2.h = hi(EBIU_AMBCTL0);
-       p2.l = lo(EBIU_AMBCTL0);
-       r0.h = hi(AMBCTL0VAL);
-       r0.l = lo(AMBCTL0VAL);
-       [p2] = r0;
-       ssync;
-
-       p2.h = hi(EBIU_AMGCTL);
-       p2.l = lo(EBIU_AMGCTL);
-       r0 = AMGCTLVAL;
-       w[p2] = r0;
-       ssync;
-
-       /* This section keeps the processor in supervisor mode
-        * during kernel boot.  Switches to user mode at end of boot.
-        * See page 3-9 of Hardware Reference manual for documentation.
-        */
-
-       /* EVT15 = _real_start */
-
-       p0.l = lo(EVT15);
-       p0.h = hi(EVT15);
-       p1.l = _real_start;
-       p1.h = _real_start;
-       [p0] = p1;
-       csync;
-
-       p0.l = lo(IMASK);
-       p0.h = hi(IMASK);
-       p1.l = IMASK_IVG15;
-       p1.h = 0x0;
-       [p0] = p1;
-       csync;
-
-       raise 15;
-       p0.l = .LWAIT_HERE;
-       p0.h = .LWAIT_HERE;
-       reti = p0;
-#if ANOMALY_05000281
-       nop; nop; nop;
-#endif
-       rti;
-
-.LWAIT_HERE:
-       jump .LWAIT_HERE;
-ENDPROC(__start)
-
-ENTRY(_real_start)
-       [ -- sp ] = reti;
-       p0.l = lo(WDOG_CTL);
-       p0.h = hi(WDOG_CTL);
-       r0 = 0xAD6(z);
-       w[p0] = r0;     /* watchdog off for now */
-       ssync;
-
-       /* Code update for BSS size == 0
-        * Zero out the bss region.
-        */
-
-       p1.l = ___bss_start;
-       p1.h = ___bss_start;
-       p2.l = ___bss_stop;
-       p2.h = ___bss_stop;
-       r0 = 0;
-       p2 -= p1;
-       lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2;
-.L_clear_bss:
-       B[p1++] = r0;
-
-       /* In case there is a NULL pointer reference
-        * Zero out region before stext
-        */
-
-       p1.l = 0x0;
-       p1.h = 0x0;
-       r0.l = __stext;
-       r0.h = __stext;
-       r0 = r0 >> 1;
-       p2 = r0;
-       r0 = 0;
-       lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2;
-.L_clear_zero:
-       W[p1++] = r0;
-
-       /* pass the uboot arguments to the global value command line */
-       R0 = R7;
-       call _cmdline_init;
-
-       p1.l = __rambase;
-       p1.h = __rambase;
-       r0.l = __sdata;
-       r0.h = __sdata;
-       [p1] = r0;
-
-       p1.l = __ramstart;
-       p1.h = __ramstart;
-       p3.l = ___bss_stop;
-       p3.h = ___bss_stop;
-
-       r1 = p3;
-       [p1] = r1;
-
-       /*
-        * load the current thread pointer and stack
-        */
-       r1.l = _init_thread_union;
-       r1.h = _init_thread_union;
-
-       r2.l = 0x2000;
-       r2.h = 0x0000;
-       r1 = r1 + r2;
-       sp = r1;
-       usp = sp;
-       fp = sp;
-       jump.l _start_kernel;
-ENDPROC(_real_start)
-
-__FINIT
-
 .section .l1.text
 #ifdef CONFIG_BFIN_KERNEL_CLOCK
 ENTRY(_start_dma_code)
@@ -420,13 +138,6 @@ ENTRY(_start_dma_code)
        [P2] = R1;
        SSYNC;
 
-       p0.h = hi(SIC_IWR0);
-       p0.l = lo(SIC_IWR0);
-       r0.l = lo(IWR_ENABLE_ALL);
-       r0.h = hi(IWR_ENABLE_ALL);
-       [p0] = r0;
-       SSYNC;
-
        RTS;
 ENDPROC(_start_dma_code)
 #endif /* CONFIG_BFIN_KERNEL_CLOCK */
index 1fa3897..8a23674 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/irq.h>
 #include <asm/blackfin.h>
 
-void program_IAR(void)
+void __init program_IAR(void)
 {
        /* Program the IAR0 Register with the configured priority */
        bfin_write_SIC_IAR0(((CONFIG_IRQ_PLL_WAKEUP - 7) << IRQ_PLL_WAKEUP_POS) |
index 4103a97..c66a68f 100644 (file)
@@ -38,7 +38,6 @@
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
 #include <linux/usb/isp1362.h>
 #endif
-#include <linux/ata_platform.h>
 #include <linux/irq.h>
 
 #include <asm/dma.h>
@@ -141,16 +140,16 @@ static struct platform_device net2272_bfin_device = {
 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
-               .name = "bootloader",
+               .name = "bootloader(spi)",
                .size = 0x00060000,
                .offset = 0,
                .mask_flags = MTD_CAP_ROM
        }, {
-               .name = "kernel",
+               .name = "linux kernel(spi)",
                .size = 0x100000,
                .offset = 0x60000
        }, {
-               .name = "file system",
+               .name = "file system(spi)",
                .size = 0x6a0000,
                .offset = 0x00160000,
        }
index 8400592..308c98d 100644 (file)
@@ -14,6 +14,12 @@ config BFIN533_STAMP
        help
          BF533-STAMP board support.
 
+config BLACKSTAMP
+       bool "BlackStamp"
+       help
+         Support for the BlackStamp board.  Hardware info available at
+         http://blackfin.uclinux.org/gf/project/blackstamp/
+
 config BFIN533_BLUETECHNIX_CM
        bool "Bluetechnix CM-BF533"
        depends on (BF533)
index b7a1a1d..9afbe72 100644 (file)
@@ -7,4 +7,5 @@ obj-$(CONFIG_BFIN533_STAMP)            += stamp.o
 obj-$(CONFIG_BFIN532_IP0X)             += ip0x.o
 obj-$(CONFIG_BFIN533_EZKIT)            += ezkit.o
 obj-$(CONFIG_BFIN533_BLUETECHNIX_CM)   += cm_bf533.o
+obj-$(CONFIG_BLACKSTAMP)               += blackstamp.o
 obj-$(CONFIG_H8606_HVSISTEMAS)         += H8606.o
diff --git a/arch/blackfin/mach-bf533/boards/blackstamp.c b/arch/blackfin/mach-bf533/boards/blackstamp.c
new file mode 100644 (file)
index 0000000..d064ded
--- /dev/null
@@ -0,0 +1,401 @@
+/*
+ * File:         arch/blackfin/mach-bf533/blackstamp.c
+ * Based on:     arch/blackfin/mach-bf533/stamp.c
+ * Author:       Benjamin Matthews <bmat@lle.rochester.edu>
+ *               Aidan Williams <aidan@nicta.com.au>
+ *
+ * Created:      2008
+ * Description:  Board Info File for the BlackStamp
+ *
+ * Copyright 2005 National ICT Australia (NICTA)
+ * Copyright 2004-2008 Analog Devices Inc.
+ *
+ * Enter bugs at http://blackfin.uclinux.org/
+ *
+ * More info about the BlackStamp at:
+ *     http://blackfin.uclinux.org/gf/project/blackstamp/
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+#include <linux/irq.h>
+#include <linux/i2c.h>
+#include <asm/dma.h>
+#include <asm/bfin5xx_spi.h>
+#include <asm/portmux.h>
+#include <asm/dpmc.h>
+
+/*
+ * Name the Board for the /proc/cpuinfo
+ */
+const char bfin_board_name[] = "BlackStamp";
+
+#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
+static struct platform_device rtc_device = {
+       .name = "rtc-bfin",
+       .id   = -1,
+};
+#endif
+
+/*
+ *  Driver needs to know address, irq and flag pin.
+ */
+#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
+static struct resource smc91x_resources[] = {
+       {
+               .name = "smc91x-regs",
+               .start = 0x20300300,
+               .end = 0x20300300 + 16,
+               .flags = IORESOURCE_MEM,
+       }, {
+               .start = IRQ_PF3,
+               .end = IRQ_PF3,
+               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
+       },
+};
+
+static struct platform_device smc91x_device = {
+       .name = "smc91x",
+       .id = 0,
+       .num_resources = ARRAY_SIZE(smc91x_resources),
+       .resource = smc91x_resources,
+};
+#endif
+
+#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
+static struct mtd_partition bfin_spi_flash_partitions[] = {
+       {
+               .name = "bootloader(spi)",
+               .size = 0x00040000,
+               .offset = 0,
+               .mask_flags = MTD_CAP_ROM
+       }, {
+               .name = "linux kernel(spi)",
+               .size = 0x180000,
+               .offset = MTDPART_OFS_APPEND,
+       }, {
+               .name = "file system(spi)",
+               .size = MTDPART_SIZ_FULL,
+               .offset = MTDPART_OFS_APPEND,
+       }
+};
+
+static struct flash_platform_data bfin_spi_flash_data = {
+       .name = "m25p80",
+       .parts = bfin_spi_flash_partitions,
+       .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
+       .type = "m25p64",
+};
+
+/* SPI flash chip (m25p64) */
+static struct bfin5xx_spi_chip spi_flash_chip_info = {
+       .enable_dma = 0,         /* use dma transfer with this chip*/
+       .bits_per_word = 8,
+};
+#endif
+
+#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
+static struct bfin5xx_spi_chip spi_mmc_chip_info = {
+       .enable_dma = 1,
+       .bits_per_word = 8,
+};
+#endif
+
+#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
+static struct bfin5xx_spi_chip spidev_chip_info = {
+       .enable_dma = 0,
+       .bits_per_word = 8,
+};
+#endif
+
+static struct spi_board_info bfin_spi_board_info[] __initdata = {
+#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
+       {
+               /* the modalias must be the same as spi device driver name */
+               .modalias = "m25p80", /* Name of spi_driver for this device */
+               .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0, /* Framework bus number */
+               .chip_select = 2, /* Framework chip select. */
+               .platform_data = &bfin_spi_flash_data,
+               .controller_data = &spi_flash_chip_info,
+               .mode = SPI_MODE_3,
+       },
+#endif
+
+#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
+       {
+               .modalias = "spi_mmc_dummy",
+               .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0,
+               .chip_select = 0,
+               .platform_data = NULL,
+               .controller_data = &spi_mmc_chip_info,
+               .mode = SPI_MODE_3,
+       },
+       {
+               .modalias = "spi_mmc",
+               .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0,
+               .chip_select = CONFIG_SPI_MMC_CS_CHAN,
+               .platform_data = NULL,
+               .controller_data = &spi_mmc_chip_info,
+               .mode = SPI_MODE_3,
+       },
+#endif
+
+#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
+       {
+               .modalias = "spidev",
+               .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0,
+               .chip_select = 7,
+               .controller_data = &spidev_chip_info,
+       },
+#endif
+};
+
+#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
+/* SPI (0) */
+static struct resource bfin_spi0_resource[] = {
+       [0] = {
+               .start = SPI0_REGBASE,
+               .end   = SPI0_REGBASE + 0xFF,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = CH_SPI,
+               .end   = CH_SPI,
+               .flags = IORESOURCE_IRQ,
+       }
+};
+
+/* SPI controller data */
+static struct bfin5xx_spi_master bfin_spi0_info = {
+       .num_chipselect = 8,
+       .enable_dma = 1,  /* master has the ability to do dma transfer */
+       .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
+};
+
+static struct platform_device bfin_spi0_device = {
+       .name = "bfin-spi",
+       .id = 0, /* Bus number */
+       .num_resources = ARRAY_SIZE(bfin_spi0_resource),
+       .resource = bfin_spi0_resource,
+       .dev = {
+               .platform_data = &bfin_spi0_info, /* Passed to driver */
+       },
+};
+#endif  /* spi master and devices */
+
+#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
+static struct resource bfin_uart_resources[] = {
+       {
+               .start = 0xFFC00400,
+               .end = 0xFFC004FF,
+               .flags = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device bfin_uart_device = {
+       .name = "bfin-uart",
+       .id = 1,
+       .num_resources = ARRAY_SIZE(bfin_uart_resources),
+       .resource = bfin_uart_resources,
+};
+#endif
+
+#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
+static struct resource bfin_sir_resources[] = {
+#ifdef CONFIG_BFIN_SIR0
+       {
+               .start = 0xFFC00400,
+               .end = 0xFFC004FF,
+               .flags = IORESOURCE_MEM,
+       },
+#endif
+};
+
+static struct platform_device bfin_sir_device = {
+       .name = "bfin_sir",
+       .id = 0,
+       .num_resources = ARRAY_SIZE(bfin_sir_resources),
+       .resource = bfin_sir_resources,
+};
+#endif
+
+#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
+static struct platform_device bfin_sport0_uart_device = {
+       .name = "bfin-sport-uart",
+       .id = 0,
+};
+
+static struct platform_device bfin_sport1_uart_device = {
+       .name = "bfin-sport-uart",
+       .id = 1,
+};
+#endif
+
+#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
+#include <linux/input.h>
+#include <linux/gpio_keys.h>
+
+static struct gpio_keys_button bfin_gpio_keys_table[] = {
+       {BTN_0, GPIO_PF4, 0, "gpio-keys: BTN0"},
+       {BTN_1, GPIO_PF5, 0, "gpio-keys: BTN1"},
+       {BTN_2, GPIO_PF6, 0, "gpio-keys: BTN2"},
+}; /* Mapped to the first three PF Test Points */
+
+static struct gpio_keys_platform_data bfin_gpio_keys_data = {
+       .buttons        = bfin_gpio_keys_table,
+       .nbuttons       = ARRAY_SIZE(bfin_gpio_keys_table),
+};
+
+static struct platform_device bfin_device_gpiokeys = {
+       .name      = "gpio-keys",
+       .dev = {
+               .platform_data = &bfin_gpio_keys_data,
+       },
+};
+#endif
+
+static struct resource bfin_gpios_resources = {
+       .start = 0,
+       .end   = MAX_BLACKFIN_GPIOS - 1,
+       .flags = IORESOURCE_IRQ,
+};
+
+static struct platform_device bfin_gpios_device = {
+       .name = "simple-gpio",
+       .id = -1,
+       .num_resources = 1,
+       .resource = &bfin_gpios_resources,
+};
+
+#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
+#include <linux/i2c-gpio.h>
+
+static struct i2c_gpio_platform_data i2c_gpio_data = {
+       .sda_pin                = 8,
+       .scl_pin                = 9,
+       .sda_is_open_drain      = 0,
+       .scl_is_open_drain      = 0,
+       .udelay                 = 40,
+}; /* This hasn't actually been used these pins
+    * are (currently) free pins on the expansion connector */
+
+static struct platform_device i2c_gpio_device = {
+       .name           = "i2c-gpio",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &i2c_gpio_data,
+       },
+};
+#endif
+
+#ifdef CONFIG_I2C_BOARDINFO
+static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
+};
+#endif
+
+static const unsigned int cclk_vlev_datasheet[] =
+{
+       VRPAIR(VLEV_085, 250000000),
+       VRPAIR(VLEV_090, 376000000),
+       VRPAIR(VLEV_095, 426000000),
+       VRPAIR(VLEV_100, 426000000),
+       VRPAIR(VLEV_105, 476000000),
+       VRPAIR(VLEV_110, 476000000),
+       VRPAIR(VLEV_115, 476000000),
+       VRPAIR(VLEV_120, 600000000),
+       VRPAIR(VLEV_125, 600000000),
+       VRPAIR(VLEV_130, 600000000),
+};
+
+static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
+       .tuple_tab = cclk_vlev_datasheet,
+       .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
+       .vr_settling_time = 25 /* us */,
+};
+
+static struct platform_device bfin_dpmc = {
+       .name = "bfin dpmc",
+       .dev = {
+               .platform_data = &bfin_dmpc_vreg_data,
+       },
+};
+
+static struct platform_device *stamp_devices[] __initdata = {
+
+       &bfin_dpmc,
+
+#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
+       &rtc_device,
+#endif
+
+#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
+       &smc91x_device,
+#endif
+
+
+#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
+       &bfin_spi0_device,
+#endif
+
+#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
+       &bfin_uart_device,
+#endif
+
+#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
+       &bfin_sir_device,
+#endif
+
+#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
+       &bfin_sport0_uart_device,
+       &bfin_sport1_uart_device,
+#endif
+
+#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
+       &bfin_device_gpiokeys,
+#endif
+
+#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
+       &i2c_gpio_device,
+#endif
+
+       &bfin_gpios_device,
+};
+
+static int __init blackstamp_init(void)
+{
+       int ret;
+
+       printk(KERN_INFO "%s(): registering device resources\n", __func__);
+
+#ifdef CONFIG_I2C_BOARDINFO
+       i2c_register_board_info(0, bfin_i2c_board_info,
+                               ARRAY_SIZE(bfin_i2c_board_info));
+#endif
+
+       ret = platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
+       if (ret < 0)
+               return ret;
+
+#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
+       /* setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC */
+       bfin_write_FIO_DIR(bfin_read_FIO_DIR() | PF0);
+       bfin_write_FIO_FLAG_S(PF0);
+       SSYNC();
+#endif
+
+       spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
+       return 0;
+}
+
+arch_initcall(blackstamp_init);
index ed2b0b8..575843f 100644 (file)
@@ -36,7 +36,6 @@
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
 #include <linux/usb/isp1362.h>
 #endif
-#include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
@@ -53,16 +52,16 @@ const char bfin_board_name[] = "Bluetechnix CM BF533";
 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
-               .name = "bootloader",
+               .name = "bootloader(spi)",
                .size = 0x00020000,
                .offset = 0,
                .mask_flags = MTD_CAP_ROM
        }, {
-               .name = "kernel",
+               .name = "linux kernel(spi)",
                .size = 0xe0000,
                .offset = 0x20000
        }, {
-               .name = "file system",
+               .name = "file system(spi)",
                .size = 0x700000,
                .offset = 0x00100000,
        }
@@ -307,43 +306,6 @@ static struct platform_device isp1362_hcd_device = {
 };
 #endif
 
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-#define PATA_INT       38
-
-static struct pata_platform_info bfin_pata_platform_data = {
-       .ioport_shift = 2,
-       .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
-};
-
-static struct resource bfin_pata_resources[] = {
-       {
-               .start = 0x2030C000,
-               .end = 0x2030C01F,
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .start = 0x2030D018,
-               .end = 0x2030D01B,
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .start = PATA_INT,
-               .end = PATA_INT,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device bfin_pata_device = {
-       .name = "pata_platform",
-       .id = -1,
-       .num_resources = ARRAY_SIZE(bfin_pata_resources),
-       .resource = bfin_pata_resources,
-       .dev = {
-               .platform_data = &bfin_pata_platform_data,
-       }
-};
-#endif
-
 static const unsigned int cclk_vlev_datasheet[] =
 {
        VRPAIR(VLEV_085, 250000000),
@@ -403,10 +365,6 @@ static struct platform_device *cm_bf533_devices[] __initdata = {
 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
        &bfin_spi0_device,
 #endif
-
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-       &bfin_pata_device,
-#endif
 };
 
 static int __init cm_bf533_init(void)
@@ -416,10 +374,6 @@ static int __init cm_bf533_init(void)
 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
        spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
 #endif
-
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-       irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
-#endif
        return 0;
 }
 
index 079389c..cc2e7ee 100644 (file)
@@ -37,7 +37,6 @@
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
 #include <linux/usb/isp1362.h>
 #endif
-#include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
@@ -90,16 +89,16 @@ static struct platform_device smc91x_device = {
 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
-               .name = "bootloader",
+               .name = "bootloader(spi)",
                .size = 0x00020000,
                .offset = 0,
                .mask_flags = MTD_CAP_ROM
        }, {
-               .name = "kernel",
+               .name = "linux kernel(spi)",
                .size = 0xe0000,
                .offset = MTDPART_OFS_APPEND,
        }, {
-               .name = "file system",
+               .name = "file system(spi)",
                .size = MTDPART_SIZ_FULL,
                .offset = MTDPART_OFS_APPEND,
        }
@@ -255,43 +254,6 @@ static struct platform_device bfin_sir_device = {
 };
 #endif
 
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-#define PATA_INT       55
-
-static struct pata_platform_info bfin_pata_platform_data = {
-       .ioport_shift = 1,
-       .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
-};
-
-static struct resource bfin_pata_resources[] = {
-       {
-               .start = 0x20314020,
-               .end = 0x2031403F,
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .start = 0x2031401C,
-               .end = 0x2031401F,
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .start = PATA_INT,
-               .end = PATA_INT,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device bfin_pata_device = {
-       .name = "pata_platform",
-       .id = -1,
-       .num_resources = ARRAY_SIZE(bfin_pata_resources),
-       .resource = bfin_pata_resources,
-       .dev = {
-               .platform_data = &bfin_pata_platform_data,
-       }
-};
-#endif
-
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
@@ -404,10 +366,6 @@ static struct platform_device *ezkit_devices[] __initdata = {
        &bfin_sir_device,
 #endif
 
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-       &bfin_pata_device,
-#endif
-
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
        &bfin_device_gpiokeys,
 #endif
@@ -424,10 +382,6 @@ static int __init ezkit_init(void)
        printk(KERN_INFO "%s(): registering device resources\n", __func__);
        platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
        spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
-
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-       irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
-#endif
        return 0;
 }
 
index 13ae495..050ffca 100644 (file)
@@ -38,7 +38,6 @@
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
 #include <linux/usb/isp1362.h>
 #endif
-#include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <linux/i2c.h>
 #include <asm/dma.h>
@@ -114,15 +113,15 @@ static struct platform_device net2272_bfin_device = {
 #if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE)
 static struct mtd_partition stamp_partitions[] = {
        {
-               .name   = "Bootloader",
+               .name   = "bootloader(nor)",
                .size   = 0x40000,
                .offset = 0,
        }, {
-               .name   = "Kernel",
+               .name   = "linux kernel(nor)",
                .size   = 0xE0000,
                .offset = MTDPART_OFS_APPEND,
        }, {
-               .name   = "RootFS",
+               .name   = "file system(nor)",
                .size   = MTDPART_SIZ_FULL,
                .offset = MTDPART_OFS_APPEND,
        }
@@ -164,16 +163,16 @@ static struct platform_device stamp_flash_device = {
 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
-               .name = "bootloader",
+               .name = "bootloader(spi)",
                .size = 0x00040000,
                .offset = 0,
                .mask_flags = MTD_CAP_ROM
        }, {
-               .name = "kernel",
+               .name = "linux kernel(spi)",
                .size = 0xe0000,
                .offset = MTDPART_OFS_APPEND,
        }, {
-               .name = "file system",
+               .name = "file system(spi)",
                .size = MTDPART_SIZ_FULL,
                .offset = MTDPART_OFS_APPEND,
        }
@@ -404,43 +403,6 @@ static struct platform_device bfin_sport1_uart_device = {
 };
 #endif
 
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-#define PATA_INT       55
-
-static struct pata_platform_info bfin_pata_platform_data = {
-       .ioport_shift = 1,
-       .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
-};
-
-static struct resource bfin_pata_resources[] = {
-       {
-               .start = 0x20314020,
-               .end = 0x2031403F,
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .start = 0x2031401C,
-               .end = 0x2031401F,
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .start = PATA_INT,
-               .end = PATA_INT,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device bfin_pata_device = {
-       .name = "pata_platform",
-       .id = -1,
-       .num_resources = ARRAY_SIZE(bfin_pata_resources),
-       .resource = bfin_pata_resources,
-       .dev = {
-               .platform_data = &bfin_pata_platform_data,
-       }
-};
-#endif
-
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
@@ -583,10 +545,6 @@ static struct platform_device *stamp_devices[] __initdata = {
        &bfin_sport1_uart_device,
 #endif
 
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-       &bfin_pata_device,
-#endif
-
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
        &bfin_device_gpiokeys,
 #endif
@@ -625,10 +583,6 @@ static int __init stamp_init(void)
 #endif
 
        spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
-
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-       irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
-#endif
        return 0;
 }
 
index c671e85..d59db86 100644 (file)
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <asm/blackfin.h>
-#include <asm/trace.h>
 #ifdef CONFIG_BFIN_KERNEL_CLOCK
 #include <asm/mach-common/clocks.h>
 #include <asm/mach/mem_init.h>
 #endif
 
-.extern ___bss_stop
-.extern ___bss_start
-.extern _bf53x_relocate_l1_mem
-
-#define INITIAL_STACK  0xFFB01000
-
-__INIT
-
-ENTRY(__start)
-       /* R0: argument of command line string, passed from uboot, save it */
-       R7 = R0;
-       /* Enable Cycle Counter and Nesting Of Interrupts */
-#ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES
-       R0 = SYSCFG_SNEN;
-#else
-       R0 = SYSCFG_SNEN | SYSCFG_CCEN;
-#endif
-       SYSCFG = R0;
-       R0 = 0;
-
-       /* Clear Out All the data and pointer Registers */
-       R1 = R0;
-       R2 = R0;
-       R3 = R0;
-       R4 = R0;
-       R5 = R0;
-       R6 = R0;
-
-       P0 = R0;
-       P1 = R0;
-       P2 = R0;
-       P3 = R0;
-       P4 = R0;
-       P5 = R0;
-
-       LC0 = r0;
-       LC1 = r0;
-       L0 = r0;
-       L1 = r0;
-       L2 = r0;
-       L3 = r0;
-
-       /* Clear Out All the DAG Registers */
-       B0 = r0;
-       B1 = r0;
-       B2 = r0;
-       B3 = r0;
-
-       I0 = r0;
-       I1 = r0;
-       I2 = r0;
-       I3 = r0;
-
-       M0 = r0;
-       M1 = r0;
-       M2 = r0;
-       M3 = r0;
-
-       trace_buffer_init(p0,r0);
-       P0 = R1;
-       R0 = R1;
-
-       p0.h = hi(FIO_MASKA_C);
-       p0.l = lo(FIO_MASKA_C);
-       r0 = 0xFFFF(Z);
-       w[p0] = r0.L;   /* Disable all interrupts */
-       ssync;
-
-       p0.h = hi(FIO_MASKB_C);
-       p0.l = lo(FIO_MASKB_C);
-       r0 = 0xFFFF(Z);
-       w[p0] = r0.L;   /* Disable all interrupts */
-       ssync;
-
-       /* Turn off the icache */
-       p0.l = LO(IMEM_CONTROL);
-       p0.h = HI(IMEM_CONTROL);
-       R1 = [p0];
-       R0 = ~ENICPLB;
-       R0 = R0 & R1;
-
-       /* Anomaly 05000125 */
-#if ANOMALY_05000125
-       CLI R2;
-       SSYNC;
-#endif
-       [p0] = R0;
-       SSYNC;
-#if ANOMALY_05000125
-       STI R2;
-#endif
-
-       /* Turn off the dcache */
-       p0.l = LO(DMEM_CONTROL);
-       p0.h = HI(DMEM_CONTROL);
-       R1 = [p0];
-       R0 = ~ENDCPLB;
-       R0 = R0 & R1;
-
-       /* Anomaly 05000125 */
-#if ANOMALY_05000125
-       CLI R2;
-       SSYNC;
-#endif
-       [p0] = R0;
-       SSYNC;
-#if ANOMALY_05000125
-       STI R2;
-#endif
-
-       /* Initialise UART - when booting from u-boot, the UART is not disabled
-        * so if we dont initalize here, our serial console gets hosed */
-       p0.h = hi(BFIN_UART_LCR);
-       p0.l = lo(BFIN_UART_LCR);
-       r0 = 0x0(Z);
-       w[p0] = r0.L;   /* To enable DLL writes */
-       ssync;
-
-       p0.h = hi(BFIN_UART_DLL);
-       p0.l = lo(BFIN_UART_DLL);
-       r0 = 0x0(Z);
-       w[p0] = r0.L;
-       ssync;
-
-       p0.h = hi(BFIN_UART_DLH);
-       p0.l = lo(BFIN_UART_DLH);
-       r0 = 0x00(Z);
-       w[p0] = r0.L;
-       ssync;
-
-       p0.h = hi(BFIN_UART_GCTL);
-       p0.l = lo(BFIN_UART_GCTL);
-       r0 = 0x0(Z);
-       w[p0] = r0.L;   /* To enable UART clock */
-       ssync;
-
-       /* Initialize stack pointer */
-       sp.l = lo(INITIAL_STACK);
-       sp.h = hi(INITIAL_STACK);
-       fp = sp;
-       usp = sp;
-
-#ifdef CONFIG_EARLY_PRINTK
-       SP += -12;
-       call _init_early_exception_vectors;
-       SP += 12;
-#endif
-
-       /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
-       call _bf53x_relocate_l1_mem;
-#ifdef CONFIG_BFIN_KERNEL_CLOCK
-       call _start_dma_code;
-#endif
-
-       /* Code for initializing Async memory banks */
-
-       p2.h = hi(EBIU_AMBCTL1);
-       p2.l = lo(EBIU_AMBCTL1);
-       r0.h = hi(AMBCTL1VAL);
-       r0.l = lo(AMBCTL1VAL);
-       [p2] = r0;
-       ssync;
-
-       p2.h = hi(EBIU_AMBCTL0);
-       p2.l = lo(EBIU_AMBCTL0);
-       r0.h = hi(AMBCTL0VAL);
-       r0.l = lo(AMBCTL0VAL);
-       [p2] = r0;
-       ssync;
-
-       p2.h = hi(EBIU_AMGCTL);
-       p2.l = lo(EBIU_AMGCTL);
-       r0 = AMGCTLVAL;
-       w[p2] = r0;
-       ssync;
-
-       /* This section keeps the processor in supervisor mode
-        * during kernel boot.  Switches to user mode at end of boot.
-        * See page 3-9 of Hardware Reference manual for documentation.
-        */
-
-       /* EVT15 = _real_start */
-
-       p0.l = lo(EVT15);
-       p0.h = hi(EVT15);
-       p1.l = _real_start;
-       p1.h = _real_start;
-       [p0] = p1;
-       csync;
-
-       p0.l = lo(IMASK);
-       p0.h = hi(IMASK);
-       p1.l = IMASK_IVG15;
-       p1.h = 0x0;
-       [p0] = p1;
-       csync;
-
-       raise 15;
-       p0.l = .LWAIT_HERE;
-       p0.h = .LWAIT_HERE;
-       reti = p0;
-#if ANOMALY_05000281
-       nop; nop; nop;
-#endif
-       rti;
-
-.LWAIT_HERE:
-       jump .LWAIT_HERE;
-ENDPROC(__start)
-
-ENTRY(_real_start)
-       [ -- sp ] = reti;
-       p0.l = lo(WDOG_CTL);
-       p0.h = hi(WDOG_CTL);
-       r0 = 0xAD6(z);
-       w[p0] = r0;     /* watchdog off for now */
-       ssync;
-
-       /* Code update for BSS size == 0
-        * Zero out the bss region.
-        */
-
-       p1.l = ___bss_start;
-       p1.h = ___bss_start;
-       p2.l = ___bss_stop;
-       p2.h = ___bss_stop;
-       r0 = 0;
-       p2 -= p1;
-       lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2;
-.L_clear_bss:
-       B[p1++] = r0;
-
-       /* In case there is a NULL pointer reference
-        * Zero out region before stext
-        */
-
-       p1.l = 0x0;
-       p1.h = 0x0;
-       r0.l = __stext;
-       r0.h = __stext;
-       r0 = r0 >> 1;
-       p2 = r0;
-       r0 = 0;
-       lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2;
-.L_clear_zero:
-       W[p1++] = r0;
-
-       /* pass the uboot arguments to the global value command line */
-       R0 = R7;
-       call _cmdline_init;
-
-       p1.l = __rambase;
-       p1.h = __rambase;
-       r0.l = __sdata;
-       r0.h = __sdata;
-       [p1] = r0;
-
-       p1.l = __ramstart;
-       p1.h = __ramstart;
-       p3.l = ___bss_stop;
-       p3.h = ___bss_stop;
-
-       r1 = p3;
-       [p1] = r1;
-
-       /*
-        * load the current thread pointer and stack
-        */
-       r1.l = _init_thread_union;
-       r1.h = _init_thread_union;
-
-       r2.l = 0x2000;
-       r2.h = 0x0000;
-       r1 = r1 + r2;
-       sp = r1;
-       usp = sp;
-       fp = sp;
-       jump.l _start_kernel;
-ENDPROC(_real_start)
-
-__FINIT
-
 .section .l1.text
 #ifdef CONFIG_BFIN_KERNEL_CLOCK
 ENTRY(_start_dma_code)
@@ -412,13 +129,6 @@ ENTRY(_start_dma_code)
        [P2] = R1;
        SSYNC;
 
-       p0.h = hi(SIC_IWR);
-       p0.l = lo(SIC_IWR);
-       r0.l = lo(IWR_ENABLE_ALL);
-       r0.h = hi(IWR_ENABLE_ALL);
-       [p0] = r0;
-       SSYNC;
-
        RTS;
 ENDPROC(_start_dma_code)
 #endif /* CONFIG_BFIN_KERNEL_CLOCK */
index 7d79e0f..f51994b 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/irq.h>
 #include <asm/blackfin.h>
 
-void program_IAR(void)
+void __init program_IAR(void)
 {
        /* Program the IAR0 Register with the configured priority */
        bfin_write_SIC_IAR0(((CONFIG_PLLWAKE_ERROR - 7) << PLLWAKE_ERROR_POS) |
index 7e789db..42a57b0 100644 (file)
@@ -15,6 +15,12 @@ config BFIN537_BLUETECHNIX_CM
        help
          CM-BF537 support for EVAL- and DEV-Board.
 
+config BFIN537_BLUETECHNIX_TCM
+       bool "Bluetechnix TCM-BF537"
+       depends on (BF537)
+       help
+         TCM-BF537 support for EVAL- and DEV-Board.
+
 config PNAV10
        bool "PNAV board"
        depends on (BF537)
index c94f7a5..7168cc1 100644 (file)
@@ -5,5 +5,6 @@
 obj-$(CONFIG_GENERIC_BF537_BOARD)      += generic_board.o
 obj-$(CONFIG_BFIN537_STAMP)            += stamp.o
 obj-$(CONFIG_BFIN537_BLUETECHNIX_CM)   += cm_bf537.o
+obj-$(CONFIG_BFIN537_BLUETECHNIX_TCM)  += tcm_bf537.o
 obj-$(CONFIG_PNAV10)                   += pnav10.o
 obj-$(CONFIG_CAMSIG_MINOTAUR)          += minotaur.o
index 73f2142..dde1472 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/platform_device.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
@@ -56,16 +57,16 @@ const char bfin_board_name[] = "Bluetechnix CM BF537";
 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
-               .name = "bootloader",
+               .name = "bootloader(spi)",
                .size = 0x00020000,
                .offset = 0,
                .mask_flags = MTD_CAP_ROM
        }, {
-               .name = "kernel",
+               .name = "linux kernel(spi)",
                .size = 0xe0000,
                .offset = 0x20000
        }, {
-               .name = "file system",
+               .name = "file system(spi)",
                .size = 0x700000,
                .offset = 0x00100000,
        }
@@ -307,6 +308,55 @@ static struct platform_device net2272_bfin_device = {
 };
 #endif
 
+#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
+static struct mtd_partition cm_partitions[] = {
+       {
+               .name   = "bootloader(nor)",
+               .size   = 0x40000,
+               .offset = 0,
+       }, {
+               .name   = "linux kernel(nor)",
+               .size   = 0xE0000,
+               .offset = MTDPART_OFS_APPEND,
+       }, {
+               .name   = "file system(nor)",
+               .size   = MTDPART_SIZ_FULL,
+               .offset = MTDPART_OFS_APPEND,
+       }
+};
+
+static struct physmap_flash_data cm_flash_data = {
+       .width    = 2,
+       .parts    = cm_partitions,
+       .nr_parts = ARRAY_SIZE(cm_partitions),
+};
+
+static unsigned cm_flash_gpios[] = { GPIO_PF4 };
+
+static struct resource cm_flash_resource[] = {
+       {
+               .name  = "cfi_probe",
+               .start = 0x20000000,
+               .end   = 0x201fffff,
+               .flags = IORESOURCE_MEM,
+       }, {
+               .start = (unsigned long)cm_flash_gpios,
+               .end   = ARRAY_SIZE(cm_flash_gpios),
+               .flags = IORESOURCE_IRQ,
+       }
+};
+
+static struct platform_device cm_flash_device = {
+       .name          = "gpio-addr-flash",
+       .id            = 0,
+       .dev = {
+               .platform_data = &cm_flash_data,
+       },
+       .num_resources = ARRAY_SIZE(cm_flash_resource),
+       .resource      = cm_flash_resource,
+};
+#endif
+
 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
 static struct resource bfin_uart_resources[] = {
        {
@@ -395,7 +445,7 @@ static struct platform_device bfin_mac_device = {
 #endif
 
 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-#define PATA_INT       64
+#define PATA_INT       IRQ_PF14
 
 static struct pata_platform_info bfin_pata_platform_data = {
        .ioport_shift = 2,
@@ -510,6 +560,10 @@ static struct platform_device *cm_bf537_devices[] __initdata = {
 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
        &bfin_pata_device,
 #endif
+
+#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
+       &cm_flash_device,
+#endif
 };
 
 static int __init cm_bf537_init(void)
index 01b63e2..78a13d5 100644 (file)
@@ -38,7 +38,6 @@
 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
 #include <linux/usb/isp1362.h>
 #endif
-#include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/usb/sl811.h>
@@ -307,16 +306,16 @@ static struct platform_device net2272_bfin_device = {
        || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
-               .name = "bootloader",
+               .name = "bootloader(spi)",
                .size = 0x00020000,
                .offset = 0,
                .mask_flags = MTD_CAP_ROM
        }, {
-               .name = "kernel",
+               .name = "linux kernel(spi)",
                .size = 0xe0000,
                .offset = 0x20000
        }, {
-               .name = "file system",
+               .name = "file system(spi)",
                .size = 0x700000,
                .offset = 0x00100000,
        }
@@ -619,43 +618,6 @@ static struct platform_device bfin_sport1_uart_device = {
 };
 #endif
 
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-#define PATA_INT       55
-
-static struct pata_platform_info bfin_pata_platform_data = {
-       .ioport_shift = 1,
-       .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
-};
-
-static struct resource bfin_pata_resources[] = {
-       {
-               .start = 0x20314020,
-               .end = 0x2031403F,
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .start = 0x2031401C,
-               .end = 0x2031401F,
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .start = PATA_INT,
-               .end = PATA_INT,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device bfin_pata_device = {
-       .name = "pata_platform",
-       .id = -1,
-       .num_resources = ARRAY_SIZE(bfin_pata_resources),
-       .resource = bfin_pata_resources,
-       .dev = {
-               .platform_data = &bfin_pata_platform_data,
-       }
-};
-#endif
-
 static struct platform_device *stamp_devices[] __initdata = {
 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
        &bfin_pcmcia_cf_device,
@@ -717,10 +679,6 @@ static struct platform_device *stamp_devices[] __initdata = {
        &bfin_sport0_uart_device,
        &bfin_sport1_uart_device,
 #endif
-
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-       &bfin_pata_device,
-#endif
 };
 
 static int __init stamp_init(void)
@@ -732,9 +690,6 @@ static int __init stamp_init(void)
                                ARRAY_SIZE(bfin_spi_board_info));
 #endif
 
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-       irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
-#endif
        return 0;
 }
 
index 18ddf7a..48c4cd2 100644 (file)
@@ -100,16 +100,16 @@ static struct platform_device net2272_bfin_device = {
 
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
-               .name       = "uboot",
+               .name       = "bootloader(spi)",
                .size       = PSIZE_UBOOT,
                .offset     = 0x000000,
                .mask_flags = MTD_CAP_ROM
        }, {
-               .name       = "initramfs",
+               .name       = "initramfs(spi)",
                .size       = PSIZE_INITRAMFS,
                .offset     = PSIZE_UBOOT
        }, {
-               .name       = "opt",
+               .name       = "opt(spi)",
                .size       = FLASH_SIZE - (PSIZE_UBOOT + PSIZE_INITRAMFS),
                .offset     = PSIZE_UBOOT + PSIZE_INITRAMFS,
        }
index 51c3bab..f9174c1 100644 (file)
@@ -231,16 +231,16 @@ static struct platform_device net2272_bfin_device = {
        || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
-               .name = "bootloader",
+               .name = "bootloader(spi)",
                .size = 0x00020000,
                .offset = 0,
                .mask_flags = MTD_CAP_ROM
        }, {
-               .name = "kernel",
+               .name = "linux kernel(spi)",
                .size = 0xe0000,
                .offset = 0x20000
        }, {
-               .name = "file system",
+               .name = "file system(spi)",
                .size = 0x700000,
                .offset = 0x00100000,
        }
index 6dbc76f..e93964f 100644 (file)
@@ -364,11 +364,11 @@ const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
 
 static struct mtd_partition bfin_plat_nand_partitions[] = {
        {
-               .name   = "linux kernel",
+               .name   = "linux kernel(nand)",
                .size   = 0x400000,
                .offset = 0,
        }, {
-               .name   = "file system",
+               .name   = "file system(nand)",
                .size   = MTDPART_SIZ_FULL,
                .offset = MTDPART_OFS_APPEND,
        },
@@ -439,19 +439,19 @@ static void bfin_plat_nand_init(void) {}
 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
 static struct mtd_partition stamp_partitions[] = {
        {
-               .name       = "Bootloader",
+               .name       = "bootloader(nor)",
                .size       = 0x40000,
                .offset     = 0,
        }, {
-               .name       = "Kernel",
+               .name       = "linux kernel(nor)",
                .size       = 0xE0000,
                .offset     = MTDPART_OFS_APPEND,
        }, {
-               .name       = "RootFS",
+               .name       = "file system(nor)",
                .size       = 0x400000 - 0x40000 - 0xE0000 - 0x10000,
                .offset     = MTDPART_OFS_APPEND,
        }, {
-               .name       = "MAC Address",
+               .name       = "MAC Address(nor)",
                .size       = MTDPART_SIZ_FULL,
                .offset     = 0x3F0000,
                .mask_flags = MTD_WRITEABLE,
@@ -485,16 +485,16 @@ static struct platform_device stamp_flash_device = {
        || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
-               .name = "bootloader",
+               .name = "bootloader(spi)",
                .size = 0x00040000,
                .offset = 0,
                .mask_flags = MTD_CAP_ROM
        }, {
-               .name = "kernel",
+               .name = "linux kernel(spi)",
                .size = 0xe0000,
                .offset = MTDPART_OFS_APPEND,
        }, {
-               .name = "file system",
+               .name = "file system(spi)",
                .size = MTDPART_SIZ_FULL,
                .offset = MTDPART_OFS_APPEND,
        }
diff --git a/arch/blackfin/mach-bf537/boards/tcm_bf537.c b/arch/blackfin/mach-bf537/boards/tcm_bf537.c
new file mode 100644 (file)
index 0000000..d5ff705
--- /dev/null
@@ -0,0 +1,590 @@
+/*
+ * File:         arch/blackfin/mach-bf537/boards/tcm_bf537.c
+ * Based on:     arch/blackfin/mach-bf533/boards/cm_bf537.c
+ * Author:       Aidan Williams <aidan@nicta.com.au>
+ *
+ * Created:      2005
+ * Description:  Board description file
+ *
+ * Modified:
+ *               Copyright 2005 National ICT Australia (NICTA)
+ *               Copyright 2004-2006 Analog Devices Inc.
+ *
+ * Bugs:         Enter bugs at http://blackfin.uclinux.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see the file COPYING, or write
+ * to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/device.h>
+#include <linux/etherdevice.h>
+#include <linux/platform_device.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
+#include <linux/usb/isp1362.h>
+#endif
+#include <linux/ata_platform.h>
+#include <linux/irq.h>
+#include <asm/dma.h>
+#include <asm/bfin5xx_spi.h>
+#include <asm/portmux.h>
+#include <asm/dpmc.h>
+
+/*
+ * Name the Board for the /proc/cpuinfo
+ */
+const char bfin_board_name[] = "Bluetechnix TCM BF537";
+
+#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
+/* all SPI peripherals info goes here */
+
+#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
+static struct mtd_partition bfin_spi_flash_partitions[] = {
+       {
+               .name = "bootloader(spi)",
+               .size = 0x00020000,
+               .offset = 0,
+               .mask_flags = MTD_CAP_ROM
+       }, {
+               .name = "linux kernel(spi)",
+               .size = 0xe0000,
+               .offset = 0x20000
+       }, {
+               .name = "file system(spi)",
+               .size = 0x700000,
+               .offset = 0x00100000,
+       }
+};
+
+static struct flash_platform_data bfin_spi_flash_data = {
+       .name = "m25p80",
+       .parts = bfin_spi_flash_partitions,
+       .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
+       .type = "m25p64",
+};
+
+/* SPI flash chip (m25p64) */
+static struct bfin5xx_spi_chip spi_flash_chip_info = {
+       .enable_dma = 0,         /* use dma transfer with this chip*/
+       .bits_per_word = 8,
+};
+#endif
+
+#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
+/* SPI ADC chip */
+static struct bfin5xx_spi_chip spi_adc_chip_info = {
+       .enable_dma = 1,         /* use dma transfer with this chip*/
+       .bits_per_word = 16,
+};
+#endif
+
+#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
+static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
+       .enable_dma = 0,
+       .bits_per_word = 16,
+};
+#endif
+
+#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
+static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
+       .enable_dma = 0,
+       .bits_per_word = 16,
+};
+#endif
+
+#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
+static struct bfin5xx_spi_chip spi_mmc_chip_info = {
+       .enable_dma = 1,
+       .bits_per_word = 8,
+};
+#endif
+
+static struct spi_board_info bfin_spi_board_info[] __initdata = {
+#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
+       {
+               /* the modalias must be the same as spi device driver name */
+               .modalias = "m25p80", /* Name of spi_driver for this device */
+               .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0, /* Framework bus number */
+               .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
+               .platform_data = &bfin_spi_flash_data,
+               .controller_data = &spi_flash_chip_info,
+               .mode = SPI_MODE_3,
+       },
+#endif
+
+#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE)
+       {
+               .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
+               .max_speed_hz = 6250000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0, /* Framework bus number */
+               .chip_select = 1, /* Framework chip select. */
+               .platform_data = NULL, /* No spi_driver specific config */
+               .controller_data = &spi_adc_chip_info,
+       },
+#endif
+
+#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
+       {
+               .modalias = "ad1836-spi",
+               .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0,
+               .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
+               .controller_data = &ad1836_spi_chip_info,
+       },
+#endif
+
+#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
+       {
+               .modalias = "ad9960-spi",
+               .max_speed_hz = 10000000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0,
+               .chip_select = 1,
+               .controller_data = &ad9960_spi_chip_info,
+       },
+#endif
+
+#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
+       {
+               .modalias = "spi_mmc_dummy",
+               .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0,
+               .chip_select = 7,
+               .platform_data = NULL,
+               .controller_data = &spi_mmc_chip_info,
+               .mode = SPI_MODE_3,
+       },
+       {
+               .modalias = "spi_mmc",
+               .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0,
+               .chip_select = CONFIG_SPI_MMC_CS_CHAN,
+               .platform_data = NULL,
+               .controller_data = &spi_mmc_chip_info,
+               .mode = SPI_MODE_3,
+       },
+#endif
+};
+
+/* SPI (0) */
+static struct resource bfin_spi0_resource[] = {
+       [0] = {
+               .start = SPI0_REGBASE,
+               .end   = SPI0_REGBASE + 0xFF,
+               .flags = IORESOURCE_MEM,
+               },
+       [1] = {
+               .start = CH_SPI,
+               .end   = CH_SPI,
+               .flags = IORESOURCE_IRQ,
+       }
+};
+
+/* SPI controller data */
+static struct bfin5xx_spi_master bfin_spi0_info = {
+       .num_chipselect = 8,
+       .enable_dma = 1,  /* master has the ability to do dma transfer */
+       .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
+};
+
+static struct platform_device bfin_spi0_device = {
+       .name = "bfin-spi",
+       .id = 0, /* Bus number */
+       .num_resources = ARRAY_SIZE(bfin_spi0_resource),
+       .resource = bfin_spi0_resource,
+       .dev = {
+               .platform_data = &bfin_spi0_info, /* Passed to driver */
+       },
+};
+#endif  /* spi master and devices */
+
+#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
+static struct platform_device rtc_device = {
+       .name = "rtc-bfin",
+       .id   = -1,
+};
+#endif
+
+#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
+static struct platform_device hitachi_fb_device = {
+       .name = "hitachi-tx09",
+};
+#endif
+
+#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
+static struct resource smc91x_resources[] = {
+       {
+               .start = 0x20200300,
+               .end = 0x20200300 + 16,
+               .flags = IORESOURCE_MEM,
+       }, {
+               .start = IRQ_PF14,
+               .end = IRQ_PF14,
+               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
+               },
+};
+
+static struct platform_device smc91x_device = {
+       .name = "smc91x",
+       .id = 0,
+       .num_resources = ARRAY_SIZE(smc91x_resources),
+       .resource = smc91x_resources,
+};
+#endif
+
+#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
+static struct resource isp1362_hcd_resources[] = {
+       {
+               .start = 0x20308000,
+               .end = 0x20308000,
+               .flags = IORESOURCE_MEM,
+       }, {
+               .start = 0x20308004,
+               .end = 0x20308004,
+               .flags = IORESOURCE_MEM,
+       }, {
+               .start = IRQ_PG15,
+               .end = IRQ_PG15,
+               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
+       },
+};
+
+static struct isp1362_platform_data isp1362_priv = {
+       .sel15Kres = 1,
+       .clknotstop = 0,
+       .oc_enable = 0,
+       .int_act_high = 0,
+       .int_edge_triggered = 0,
+       .remote_wakeup_connected = 0,
+       .no_power_switching = 1,
+       .power_switching_mode = 0,
+};
+
+static struct platform_device isp1362_hcd_device = {
+       .name = "isp1362-hcd",
+       .id = 0,
+       .dev = {
+               .platform_data = &isp1362_priv,
+       },
+       .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
+       .resource = isp1362_hcd_resources,
+};
+#endif
+
+#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
+static struct resource net2272_bfin_resources[] = {
+       {
+               .start = 0x20200000,
+               .end = 0x20200000 + 0x100,
+               .flags = IORESOURCE_MEM,
+       }, {
+               .start = IRQ_PH14,
+               .end = IRQ_PH14,
+               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
+       },
+};
+
+static struct platform_device net2272_bfin_device = {
+       .name = "net2272",
+       .id = -1,
+       .num_resources = ARRAY_SIZE(net2272_bfin_resources),
+       .resource = net2272_bfin_resources,
+};
+#endif
+
+#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
+static struct mtd_partition cm_partitions[] = {
+       {
+               .name   = "bootloader(nor)",
+               .size   = 0x40000,
+               .offset = 0,
+       }, {
+               .name   = "linux kernel(nor)",
+               .size   = 0xE0000,
+               .offset = MTDPART_OFS_APPEND,
+       }, {
+               .name   = "file system(nor)",
+               .size   = MTDPART_SIZ_FULL,
+               .offset = MTDPART_OFS_APPEND,
+       }
+};
+
+static struct physmap_flash_data cm_flash_data = {
+       .width    = 2,
+       .parts    = cm_partitions,
+       .nr_parts = ARRAY_SIZE(cm_partitions),
+};
+
+static unsigned cm_flash_gpios[] = { GPIO_PF4, GPIO_PF5 };
+
+static struct resource cm_flash_resource[] = {
+       {
+               .name  = "cfi_probe",
+               .start = 0x20000000,
+               .end   = 0x201fffff,
+               .flags = IORESOURCE_MEM,
+       }, {
+               .start = (unsigned long)cm_flash_gpios,
+               .end   = ARRAY_SIZE(cm_flash_gpios),
+               .flags = IORESOURCE_IRQ,
+       }
+};
+
+static struct platform_device cm_flash_device = {
+       .name          = "gpio-addr-flash",
+       .id            = 0,
+       .dev = {
+               .platform_data = &cm_flash_data,
+       },
+       .num_resources = ARRAY_SIZE(cm_flash_resource),
+       .resource      = cm_flash_resource,
+};
+#endif
+
+#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
+static struct resource bfin_uart_resources[] = {
+       {
+               .start = 0xFFC00400,
+               .end = 0xFFC004FF,
+               .flags = IORESOURCE_MEM,
+       }, {
+               .start = 0xFFC02000,
+               .end = 0xFFC020FF,
+               .flags = IORESOURCE_MEM,
+       },
+};
+
+static struct platform_device bfin_uart_device = {
+       .name = "bfin-uart",
+       .id = 1,
+       .num_resources = ARRAY_SIZE(bfin_uart_resources),
+       .resource = bfin_uart_resources,
+};
+#endif
+
+#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
+static struct resource bfin_sir_resources[] = {
+#ifdef CONFIG_BFIN_SIR0
+       {
+               .start = 0xFFC00400,
+               .end = 0xFFC004FF,
+               .flags = IORESOURCE_MEM,
+       },
+#endif
+#ifdef CONFIG_BFIN_SIR1
+       {
+               .start = 0xFFC02000,
+               .end = 0xFFC020FF,
+               .flags = IORESOURCE_MEM,
+       },
+#endif
+};
+
+static struct platform_device bfin_sir_device = {
+       .name = "bfin_sir",
+       .id = 0,
+       .num_resources = ARRAY_SIZE(bfin_sir_resources),
+       .resource = bfin_sir_resources,
+};
+#endif
+
+#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
+static struct resource bfin_twi0_resource[] = {
+       [0] = {
+               .start = TWI0_REGBASE,
+               .end   = TWI0_REGBASE,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_TWI,
+               .end   = IRQ_TWI,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device i2c_bfin_twi_device = {
+       .name = "i2c-bfin-twi",
+       .id = 0,
+       .num_resources = ARRAY_SIZE(bfin_twi0_resource),
+       .resource = bfin_twi0_resource,
+};
+#endif
+
+#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
+static struct platform_device bfin_sport0_uart_device = {
+       .name = "bfin-sport-uart",
+       .id = 0,
+};
+
+static struct platform_device bfin_sport1_uart_device = {
+       .name = "bfin-sport-uart",
+       .id = 1,
+};
+#endif
+
+#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
+static struct platform_device bfin_mac_device = {
+       .name = "bfin_mac",
+};
+#endif
+
+#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
+#define PATA_INT       IRQ_PF14
+
+static struct pata_platform_info bfin_pata_platform_data = {
+       .ioport_shift = 2,
+       .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
+};
+
+static struct resource bfin_pata_resources[] = {
+       {
+               .start = 0x2030C000,
+               .end = 0x2030C01F,
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start = 0x2030D018,
+               .end = 0x2030D01B,
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start = PATA_INT,
+               .end = PATA_INT,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device bfin_pata_device = {
+       .name = "pata_platform",
+       .id = -1,
+       .num_resources = ARRAY_SIZE(bfin_pata_resources),
+       .resource = bfin_pata_resources,
+       .dev = {
+               .platform_data = &bfin_pata_platform_data,
+       }
+};
+#endif
+
+static const unsigned int cclk_vlev_datasheet[] =
+{
+       VRPAIR(VLEV_085, 250000000),
+       VRPAIR(VLEV_090, 376000000),
+       VRPAIR(VLEV_095, 426000000),
+       VRPAIR(VLEV_100, 426000000),
+       VRPAIR(VLEV_105, 476000000),
+       VRPAIR(VLEV_110, 476000000),
+       VRPAIR(VLEV_115, 476000000),
+       VRPAIR(VLEV_120, 500000000),
+       VRPAIR(VLEV_125, 533000000),
+       VRPAIR(VLEV_130, 600000000),
+};
+
+static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
+       .tuple_tab = cclk_vlev_datasheet,
+       .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
+       .vr_settling_time = 25 /* us */,
+};
+
+static struct platform_device bfin_dpmc = {
+       .name = "bfin dpmc",
+       .dev = {
+               .platform_data = &bfin_dmpc_vreg_data,
+       },
+};
+
+static struct platform_device *cm_bf537_devices[] __initdata = {
+
+       &bfin_dpmc,
+
+#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
+       &hitachi_fb_device,
+#endif
+
+#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
+       &rtc_device,
+#endif
+
+#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
+       &bfin_uart_device,
+#endif
+
+#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
+       &bfin_sir_device,
+#endif
+
+#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
+       &i2c_bfin_twi_device,
+#endif
+
+#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
+       &bfin_sport0_uart_device,
+       &bfin_sport1_uart_device,
+#endif
+
+#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
+       &isp1362_hcd_device,
+#endif
+
+#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
+       &smc91x_device,
+#endif
+
+#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
+       &bfin_mac_device,
+#endif
+
+#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
+       &net2272_bfin_device,
+#endif
+
+#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
+       &bfin_spi0_device,
+#endif
+
+#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
+       &bfin_pata_device,
+#endif
+
+#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
+       &cm_flash_device,
+#endif
+};
+
+static int __init cm_bf537_init(void)
+{
+       printk(KERN_INFO "%s(): registering device resources\n", __func__);
+       platform_add_devices(cm_bf537_devices, ARRAY_SIZE(cm_bf537_devices));
+#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
+       spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
+#endif
+
+#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
+       irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
+#endif
+       return 0;
+}
+
+arch_initcall(cm_bf537_init);
+
+void bfin_get_ether_addr(char *addr)
+{
+       random_ether_addr(addr);
+       printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
+}
+EXPORT_SYMBOL(bfin_get_ether_addr);
index 6b019ea..64e0287 100644 (file)
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <asm/blackfin.h>
-#include <asm/trace.h>
-
 #ifdef CONFIG_BFIN_KERNEL_CLOCK
 #include <asm/mach-common/clocks.h>
 #include <asm/mach/mem_init.h>
 #endif
 
-.extern ___bss_stop
-.extern ___bss_start
-.extern _bf53x_relocate_l1_mem
-
-#define INITIAL_STACK  0xFFB01000
-
-__INIT
-
-ENTRY(__start)
-       /* R0: argument of command line string, passed from uboot, save it */
-       R7 = R0;
-       /* Enable Cycle Counter and Nesting Of Interrupts */
-#ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES
-       R0 = SYSCFG_SNEN;
-#else
-       R0 = SYSCFG_SNEN | SYSCFG_CCEN;
-#endif
-       SYSCFG = R0;
-       R0 = 0;
-
-       /* Clear Out All the data and pointer Registers */
-       R1 = R0;
-       R2 = R0;
-       R3 = R0;
-       R4 = R0;
-       R5 = R0;
-       R6 = R0;
-
-       P0 = R0;
-       P1 = R0;
-       P2 = R0;
-       P3 = R0;
-       P4 = R0;
-       P5 = R0;
-
-       LC0 = r0;
-       LC1 = r0;
-       L0 = r0;
-       L1 = r0;
-       L2 = r0;
-       L3 = r0;
-
-       /* Clear Out All the DAG Registers */
-       B0 = r0;
-       B1 = r0;
-       B2 = r0;
-       B3 = r0;
-
-       I0 = r0;
-       I1 = r0;
-       I2 = r0;
-       I3 = r0;
-
-       M0 = r0;
-       M1 = r0;
-       M2 = r0;
-       M3 = r0;
-
-       trace_buffer_init(p0,r0);
-       P0 = R1;
-       R0 = R1;
-
-       /* Turn off the icache */
-       p0.l = LO(IMEM_CONTROL);
-       p0.h = HI(IMEM_CONTROL);
-       R1 = [p0];
-       R0 = ~ENICPLB;
-       R0 = R0 & R1;
-
-       /* Anomaly 05000125 */
-#if ANOMALY_05000125
-       CLI R2;
-       SSYNC;
-#endif
-       [p0] = R0;
-       SSYNC;
-#if ANOMALY_05000125
-       STI R2;
-#endif
-
-       /* Turn off the dcache */
-       p0.l = LO(DMEM_CONTROL);
-       p0.h = HI(DMEM_CONTROL);
-       R1 = [p0];
-       R0 = ~ENDCPLB;
-       R0 = R0 & R1;
-
-       /* Anomaly 05000125 */
-#if ANOMALY_05000125
-       CLI R2;
-       SSYNC;
-#endif
-       [p0] = R0;
-       SSYNC;
-#if ANOMALY_05000125
-       STI R2;
-#endif
-
-       /* Initialise General-Purpose I/O Modules on BF537 */
-       /* Rev 0.0 Anomaly 05000212 - PORTx_FER,
-        * PORT_MUX Registers Do Not accept "writes" correctly:
-        */
-       p0.h = hi(BFIN_PORT_MUX);
-       p0.l = lo(BFIN_PORT_MUX);
-#if ANOMALY_05000212
-       R0.L = W[P0]; /* Read */
-       SSYNC;
-#endif
-       R0 = (PGDE_UART | PFTE_UART)(Z);
-#if ANOMALY_05000212
-       W[P0] = R0.L; /* Write */
-       SSYNC;
-#endif
-       W[P0] = R0.L; /* Enable both UARTS */
-       SSYNC;
-
-       p0.h = hi(PORTF_FER);
-       p0.l = lo(PORTF_FER);
-#if ANOMALY_05000212
-       R0.L = W[P0]; /* Read */
-       SSYNC;
-#endif
-       R0 = 0x000F(Z);
-#if ANOMALY_05000212
-       W[P0] = R0.L; /* Write */
-       SSYNC;
-#endif
-       /* Enable peripheral function of PORTF for UART0 and UART1 */
-       W[P0] = R0.L;
-       SSYNC;
-
-#if !defined(CONFIG_BF534)
-       p0.h = hi(EMAC_SYSTAT);
-       p0.l = lo(EMAC_SYSTAT);
-       R0.h = 0xFFFF; /* Clear EMAC Interrupt Status bits */
-       R0.l = 0xFFFF;
-       [P0] = R0;
-       SSYNC;
-#endif
-
-       /* Initialise UART - when booting from u-boot, the UART is not disabled
-        * so if we dont initalize here, our serial console gets hosed */
-       p0.h = hi(BFIN_UART_LCR);
-       p0.l = lo(BFIN_UART_LCR);
-       r0 = 0x0(Z);
-       w[p0] = r0.L;   /* To enable DLL writes */
-       ssync;
-
-       p0.h = hi(BFIN_UART_DLL);
-       p0.l = lo(BFIN_UART_DLL);
-       r0 = 0x0(Z);
-       w[p0] = r0.L;
-       ssync;
-
-       p0.h = hi(BFIN_UART_DLH);
-       p0.l = lo(BFIN_UART_DLH);
-       r0 = 0x00(Z);
-       w[p0] = r0.L;
-       ssync;
-
-       p0.h = hi(BFIN_UART_GCTL);
-       p0.l = lo(BFIN_UART_GCTL);
-       r0 = 0x0(Z);
-       w[p0] = r0.L;   /* To enable UART clock */
-       ssync;
-
-       /* Initialize stack pointer */
-       sp.l = lo(INITIAL_STACK);
-       sp.h = hi(INITIAL_STACK);
-       fp = sp;
-       usp = sp;
-
-#ifdef CONFIG_EARLY_PRINTK
-       SP += -12;
-       call _init_early_exception_vectors;
-       SP += 12;
-#endif
-
-       /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
-       call _bf53x_relocate_l1_mem;
-#ifdef CONFIG_BFIN_KERNEL_CLOCK
-       call _start_dma_code;
-#endif
-
-       /* Code for initializing Async memory banks */
-
-       p2.h = hi(EBIU_AMBCTL1);
-       p2.l = lo(EBIU_AMBCTL1);
-       r0.h = hi(AMBCTL1VAL);
-       r0.l = lo(AMBCTL1VAL);
-       [p2] = r0;
-       ssync;
-
-       p2.h = hi(EBIU_AMBCTL0);
-       p2.l = lo(EBIU_AMBCTL0);
-       r0.h = hi(AMBCTL0VAL);
-       r0.l = lo(AMBCTL0VAL);
-       [p2] = r0;
-       ssync;
-
-       p2.h = hi(EBIU_AMGCTL);
-       p2.l = lo(EBIU_AMGCTL);
-       r0 = AMGCTLVAL;
-       w[p2] = r0;
-       ssync;
-
-       /* This section keeps the processor in supervisor mode
-        * during kernel boot.  Switches to user mode at end of boot.
-        * See page 3-9 of Hardware Reference manual for documentation.
-        */
-
-       /* EVT15 = _real_start */
-
-       p0.l = lo(EVT15);
-       p0.h = hi(EVT15);
-       p1.l = _real_start;
-       p1.h = _real_start;
-       [p0] = p1;
-       csync;
-
-       p0.l = lo(IMASK);
-       p0.h = hi(IMASK);
-       p1.l = IMASK_IVG15;
-       p1.h = 0x0;
-       [p0] = p1;
-       csync;
-
-       raise 15;
-       p0.l = .LWAIT_HERE;
-       p0.h = .LWAIT_HERE;
-       reti = p0;
-#if ANOMALY_05000281
-       nop; nop; nop;
-#endif
-       rti;
-
-.LWAIT_HERE:
-       jump .LWAIT_HERE;
-ENDPROC(__start)
-
-ENTRY(_real_start)
-       [ -- sp ] = reti;
-       p0.l = lo(WDOG_CTL);
-       p0.h = hi(WDOG_CTL);
-       r0 = 0xAD6(z);
-       w[p0] = r0;     /* watchdog off for now */
-       ssync;
-
-       /* Code update for BSS size == 0
-        * Zero out the bss region.
-        */
-
-       p1.l = ___bss_start;
-       p1.h = ___bss_start;
-       p2.l = ___bss_stop;
-       p2.h = ___bss_stop;
-       r0 = 0;
-       p2 -= p1;
-       lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2;
-.L_clear_bss:
-       B[p1++] = r0;
-
-       /* In case there is a NULL pointer reference
-        * Zero out region before stext
-        */
-
-       p1.l = 0x0;
-       p1.h = 0x0;
-       r0.l = __stext;
-       r0.h = __stext;
-       r0 = r0 >> 1;
-       p2 = r0;
-       r0 = 0;
-       lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2;
-.L_clear_zero:
-       W[p1++] = r0;
-
-       /* pass the uboot arguments to the global value command line */
-       R0 = R7;
-       call _cmdline_init;
-
-       p1.l = __rambase;
-       p1.h = __rambase;
-       r0.l = __sdata;
-       r0.h = __sdata;
-       [p1] = r0;
-
-       p1.l = __ramstart;
-       p1.h = __ramstart;
-       p3.l = ___bss_stop;
-       p3.h = ___bss_stop;
-
-       r1 = p3;
-       [p1] = r1;
-
-       /*
-        * load the current thread pointer and stack
-        */
-       r1.l = _init_thread_union;
-       r1.h = _init_thread_union;
-
-       r2.l = 0x2000;
-       r2.h = 0x0000;
-       r1 = r1 + r2;
-       sp = r1;
-       usp = sp;
-       fp = sp;
-       jump.l _start_kernel;
-ENDPROC(_real_start)
-
-__FINIT
-
 .section .l1.text
 #ifdef CONFIG_BFIN_KERNEL_CLOCK
 ENTRY(_start_dma_code)
@@ -452,13 +138,6 @@ ENTRY(_start_dma_code)
        [P2] = R1;
        SSYNC;
 
-       p0.h = hi(SIC_IWR);
-       p0.l = lo(SIC_IWR);
-       r0.l = lo(IWR_ENABLE_ALL);
-       r0.h = hi(IWR_ENABLE_ALL);
-       [p0] = r0;
-       SSYNC;
-
        RTS;
 ENDPROC(_start_dma_code)
 #endif /* CONFIG_BFIN_KERNEL_CLOCK */
index a8b915f..b1300b3 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/irq.h>
 #include <asm/blackfin.h>
 
-void program_IAR(void)
+void __init program_IAR(void)
 {
        /* Program the IAR0 Register with the configured priority */
        bfin_write_SIC_IAR0(((CONFIG_IRQ_PLL_WAKEUP - 7) << IRQ_PLL_WAKEUP_POS) |
index 4f4ae87..58abbed 100644 (file)
@@ -319,12 +319,12 @@ static struct platform_device bfin_atapi_device = {
 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
 static struct mtd_partition partition_info[] = {
        {
-               .name = "Linux Kernel",
+               .name = "linux kernel(nand)",
                .offset = 0,
                .size = 4 * SIZE_1M,
        },
        {
-               .name = "File System",
+               .name = "file system(nand)",
                .offset = 4 * SIZE_1M,
                .size = (256 - 4) * SIZE_1M,
        },
@@ -377,12 +377,12 @@ static struct platform_device bf54x_sdh_device = {
 /* SPI flash chip (m25p16) */
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
-               .name = "bootloader",
+               .name = "bootloader(spi)",
                .size = 0x00040000,
                .offset = 0,
                .mask_flags = MTD_CAP_ROM
        }, {
-               .name = "linux kernel",
+               .name = "linux kernel(spi)",
                .size = 0x1c0000,
                .offset = 0x40000
        }
index 166fa22..0d6333a 100644 (file)
@@ -365,12 +365,12 @@ static struct platform_device bfin_atapi_device = {
 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
 static struct mtd_partition partition_info[] = {
        {
-               .name = "Linux Kernel",
+               .name = "linux kernel(nand)",
                .offset = 0,
                .size = 4 * SIZE_1M,
        },
        {
-               .name = "File System",
+               .name = "file system(nand)",
                .offset = MTDPART_OFS_APPEND,
                .size = MTDPART_SIZ_FULL,
        },
@@ -419,15 +419,15 @@ static struct platform_device bf54x_sdh_device = {
 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
 static struct mtd_partition ezkit_partitions[] = {
        {
-               .name       = "Bootloader",
+               .name       = "bootloader(nor)",
                .size       = 0x40000,
                .offset     = 0,
        }, {
-               .name       = "Kernel",
+               .name       = "linux kernel(nor)",
                .size       = 0x1C0000,
                .offset     = MTDPART_OFS_APPEND,
        }, {
-               .name       = "RootFS",
+               .name       = "file system(nor)",
                .size       = MTDPART_SIZ_FULL,
                .offset     = MTDPART_OFS_APPEND,
        }
@@ -461,12 +461,12 @@ static struct platform_device ezkit_flash_device = {
 /* SPI flash chip (m25p16) */
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
-               .name = "bootloader",
+               .name = "bootloader(spi)",
                .size = 0x00040000,
                .offset = 0,
                .mask_flags = MTD_CAP_ROM
        }, {
-               .name = "linux kernel",
+               .name = "linux kernel(spi)",
                .size = MTDPART_SIZ_FULL,
                .offset = MTDPART_OFS_APPEND,
        }
index 06b9178..e3000f7 100644 (file)
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <asm/blackfin.h>
-#include <asm/trace.h>
 #ifdef CONFIG_BFIN_KERNEL_CLOCK
 #include <asm/mach-common/clocks.h>
 #include <asm/mach/mem_init.h>
 #endif
 
-.extern ___bss_stop
-.extern ___bss_start
-.extern _bf53x_relocate_l1_mem
-
-#define INITIAL_STACK   0xFFB01000
-
-__INIT
-
-ENTRY(__start)
-       /* R0: argument of command line string, passed from uboot, save it */
-       R7 = R0;
-       /* Enable Cycle Counter and Nesting Of Interrupts */
-#ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES
-       R0 = SYSCFG_SNEN;
-#else
-       R0 = SYSCFG_SNEN | SYSCFG_CCEN;
-#endif
-       SYSCFG = R0;
-       R0 = 0;
-
-       /* Clear Out All the data and pointer  Registers*/
-       R1 = R0;
-       R2 = R0;
-       R3 = R0;
-       R4 = R0;
-       R5 = R0;
-       R6 = R0;
-
-       P0 = R0;
-       P1 = R0;
-       P2 = R0;
-       P3 = R0;
-       P4 = R0;
-       P5 = R0;
-
-       LC0 = r0;
-       LC1 = r0;
-       L0 = r0;
-       L1 = r0;
-       L2 = r0;
-       L3 = r0;
-
-       /* Clear Out All the DAG Registers*/
-       B0 = r0;
-       B1 = r0;
-       B2 = r0;
-       B3 = r0;
-
-       I0 = r0;
-       I1 = r0;
-       I2 = r0;
-       I3 = r0;
-
-       M0 = r0;
-       M1 = r0;
-       M2 = r0;
-       M3 = r0;
-
-       trace_buffer_init(p0,r0);
-       P0 = R1;
-       R0 = R1;
-
-       /* Turn off the icache */
-       p0.l = LO(IMEM_CONTROL);
-       p0.h = HI(IMEM_CONTROL);
-       R1 = [p0];
-       R0 = ~ENICPLB;
-       R0 = R0 & R1;
-       [p0] = R0;
-       SSYNC;
-
-       /* Turn off the dcache */
-       p0.l = LO(DMEM_CONTROL);
-       p0.h = HI(DMEM_CONTROL);
-       R1 = [p0];
-       R0 = ~ENDCPLB;
-       R0 = R0 & R1;
-       [p0] = R0;
-       SSYNC;
-
-       /* Initialize stack pointer */
-       SP.L = LO(INITIAL_STACK);
-       SP.H = HI(INITIAL_STACK);
-       FP = SP;
-       USP = SP;
-
-#ifdef CONFIG_EARLY_PRINTK
-       SP += -12;
-       call _init_early_exception_vectors;
-       SP += 12;
-#endif
-
-       /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
-       call _bf53x_relocate_l1_mem;
-#ifdef CONFIG_BFIN_KERNEL_CLOCK
-       call _start_dma_code;
-#endif
-       /* Code for initializing Async memory banks */
-
-       p2.h = hi(EBIU_AMBCTL1);
-       p2.l = lo(EBIU_AMBCTL1);
-       r0.h = hi(AMBCTL1VAL);
-       r0.l = lo(AMBCTL1VAL);
-       [p2] = r0;
-       ssync;
-
-       p2.h = hi(EBIU_AMBCTL0);
-       p2.l = lo(EBIU_AMBCTL0);
-       r0.h = hi(AMBCTL0VAL);
-       r0.l = lo(AMBCTL0VAL);
-       [p2] = r0;
-       ssync;
-
-       p2.h = hi(EBIU_AMGCTL);
-       p2.l = lo(EBIU_AMGCTL);
-       r0 = AMGCTLVAL;
-       w[p2] = r0;
-       ssync;
-
-       p2.h = hi(EBIU_MBSCTL);
-       p2.l = lo(EBIU_MBSCTL);
-       r0.h = hi(CONFIG_EBIU_MBSCTLVAL);
-       r0.l = lo(CONFIG_EBIU_MBSCTLVAL);
-       [p2] = r0;
-       ssync;
-
-       p2.h = hi(EBIU_MODE);
-       p2.l = lo(EBIU_MODE);
-       r0.h = hi(CONFIG_EBIU_MODEVAL);
-       r0.l = lo(CONFIG_EBIU_MODEVAL);
-       [p2] = r0;
-       ssync;
-
-       p2.h = hi(EBIU_FCTL);
-       p2.l = lo(EBIU_FCTL);
-       r0.h = hi(CONFIG_EBIU_FCTLVAL);
-       r0.l = lo(CONFIG_EBIU_FCTLVAL);
-       [p2] = r0;
-       ssync;
-
-       /* This section keeps the processor in supervisor mode
-        * during kernel boot.  Switches to user mode at end of boot.
-        * See page 3-9 of Hardware Reference manual for documentation.
-        */
-
-       /* EVT15 = _real_start */
-
-       p0.l = lo(EVT15);
-       p0.h = hi(EVT15);
-       p1.l = _real_start;
-       p1.h = _real_start;
-       [p0] = p1;
-       csync;
-
-       p0.l = lo(IMASK);
-       p0.h = hi(IMASK);
-       p1.l = IMASK_IVG15;
-       p1.h = 0x0;
-       [p0] = p1;
-       csync;
-
-       raise 15;
-       p0.l = .LWAIT_HERE;
-       p0.h = .LWAIT_HERE;
-       reti = p0;
-#if ANOMALY_05000281
-       nop;
-       nop;
-       nop;
-#endif
-       rti;
-
-.LWAIT_HERE:
-       jump .LWAIT_HERE;
-ENDPROC(__start)
-
-ENTRY(_real_start)
-       [ -- sp ] = reti;
-       p0.l = lo(WDOG_CTL);
-       p0.h = hi(WDOG_CTL);
-       r0 = 0xAD6(z);
-       w[p0] = r0;     /* watchdog off for now */
-       ssync;
-
-       /* Code update for BSS size == 0
-        * Zero out the bss region.
-        */
-
-       p1.l = ___bss_start;
-       p1.h = ___bss_start;
-       p2.l = ___bss_stop;
-       p2.h = ___bss_stop;
-       r0 = 0;
-       p2 -= p1;
-       lsetup (.L_clear_bss, .L_clear_bss ) lc0 = p2;
-.L_clear_bss:
-       B[p1++] = r0;
-
-       /* In case there is a NULL pointer reference
-        * Zero out region before stext
-        */
-
-       p1.l = 0x0;
-       p1.h = 0x0;
-       r0.l = __stext;
-       r0.h = __stext;
-       r0 = r0 >> 1;
-       p2 = r0;
-       r0 = 0;
-       lsetup (.L_clear_zero, .L_clear_zero ) lc0 = p2;
-.L_clear_zero:
-       W[p1++] = r0;
-
-       /* pass the uboot arguments to the global value command line */
-       R0 = R7;
-       call _cmdline_init;
-
-       p1.l = __rambase;
-       p1.h = __rambase;
-       r0.l = __sdata;
-       r0.h = __sdata;
-       [p1] = r0;
-
-       p1.l = __ramstart;
-       p1.h = __ramstart;
-       p3.l = ___bss_stop;
-       p3.h = ___bss_stop;
-
-       r1 = p3;
-       [p1] = r1;
-
-
-       /*
-        *  load the current thread pointer and stack
-        */
-       r1.l = _init_thread_union;
-       r1.h = _init_thread_union;
-
-       r2.l = 0x2000;
-       r2.h = 0x0000;
-       r1 = r1 + r2;
-       sp = r1;
-       usp = sp;
-       fp = sp;
-       call _start_kernel;
-.L_exit:
-       jump.s  .L_exit;
-ENDPROC(_real_start)
-
-__FINIT
-
 .section .l1.text
 #ifdef CONFIG_BFIN_KERNEL_CLOCK
 ENTRY(_start_dma_code)
@@ -443,13 +191,6 @@ ENTRY(_start_dma_code)
        SSYNC;
 #endif
 
-       p0.h = hi(SIC_IWR0);
-       p0.l = lo(SIC_IWR0);
-       r0.l = lo(IWR_ENABLE_ALL);
-       r0.h = hi(IWR_ENABLE_ALL);
-       [p0] = r0;
-       SSYNC;
-
        RTS;
 ENDPROC(_start_dma_code)
 #endif /* CONFIG_BFIN_KERNEL_CLOCK */
index 2665653..9dd0fa3 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/irq.h>
 #include <asm/blackfin.h>
 
-void program_IAR(void)
+void __init program_IAR(void)
 {
        /* Program the IAR0 Register with the configured priority */
        bfin_write_SIC_IAR0(((CONFIG_IRQ_PLL_WAKEUP - 7) << IRQ_PLL_WAKEUP_POS) |
index 466ef59..8f40990 100644 (file)
@@ -54,16 +54,16 @@ const char bfin_board_name[] = "Bluetechnix CM BF561";
 #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
-               .name = "bootloader",
+               .name = "bootloader(spi)",
                .size = 0x00020000,
                .offset = 0,
                .mask_flags = MTD_CAP_ROM
        }, {
-               .name = "kernel",
+               .name = "linux kernel(spi)",
                .size = 0xe0000,
                .offset = 0x20000
        }, {
-               .name = "file system",
+               .name = "file system(spi)",
                .size = 0x700000,
                .offset = 0x00100000,
        }
@@ -306,7 +306,7 @@ static struct platform_device bfin_sir_device = {
 #endif
 
 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-#define PATA_INT       119
+#define PATA_INT       IRQ_PF46
 
 static struct pata_platform_info bfin_pata_platform_data = {
        .ioport_shift = 2,
index bc6fede..50b4cdc 100644 (file)
@@ -35,7 +35,6 @@
 #include <linux/spi/spi.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
-#include <linux/ata_platform.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
 #include <asm/portmux.h>
@@ -243,15 +242,15 @@ static struct platform_device bfin_sir_device = {
 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
 static struct mtd_partition ezkit_partitions[] = {
        {
-               .name       = "Bootloader",
+               .name       = "bootloader(nor)",
                .size       = 0x40000,
                .offset     = 0,
        }, {
-               .name       = "Kernel",
+               .name       = "linux kernel(nor)",
                .size       = 0x1C0000,
                .offset     = MTDPART_OFS_APPEND,
        }, {
-               .name       = "RootFS",
+               .name       = "file system(nor)",
                .size       = MTDPART_SIZ_FULL,
                .offset     = MTDPART_OFS_APPEND,
        }
@@ -350,43 +349,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #endif
 };
 
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-#define PATA_INT       55
-
-static struct pata_platform_info bfin_pata_platform_data = {
-       .ioport_shift = 1,
-       .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
-};
-
-static struct resource bfin_pata_resources[] = {
-       {
-               .start = 0x20314020,
-               .end = 0x2031403F,
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .start = 0x2031401C,
-               .end = 0x2031401F,
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .start = PATA_INT,
-               .end = PATA_INT,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device bfin_pata_device = {
-       .name = "pata_platform",
-       .id = -1,
-       .num_resources = ARRAY_SIZE(bfin_pata_resources),
-       .resource = bfin_pata_resources,
-       .dev = {
-               .platform_data = &bfin_pata_platform_data,
-       }
-};
-#endif
-
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
@@ -499,10 +461,6 @@ static struct platform_device *ezkit_devices[] __initdata = {
        &bfin_sir_device,
 #endif
 
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-       &bfin_pata_device,
-#endif
-
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
        &bfin_device_gpiokeys,
 #endif
@@ -538,10 +496,6 @@ static int __init ezkit_init(void)
 #endif
 
        spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
-
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-       irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
-#endif
        return 0;
 }
 
index cf1a2df..c7a81e3 100644 (file)
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <asm/blackfin.h>
-#include <asm/trace.h>
-
-#if CONFIG_BFIN_KERNEL_CLOCK
+#ifdef CONFIG_BFIN_KERNEL_CLOCK
 #include <asm/mach-common/clocks.h>
 #include <asm/mach/mem_init.h>
 #endif
 
-.extern ___bss_stop
-.extern ___bss_start
-.extern _bf53x_relocate_l1_mem
-
-#define INITIAL_STACK  0xFFB01000
-
-__INIT
-
-ENTRY(__start)
-       /* R0: argument of command line string, passed from uboot, save it */
-       R7 = R0;
-       /* Enable Cycle Counter and Nesting Of Interrupts */
-#ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES
-       R0 = SYSCFG_SNEN;
-#else
-       R0 = SYSCFG_SNEN | SYSCFG_CCEN;
-#endif
-       SYSCFG = R0;
-       R0 = 0;
-
-       /* Clear Out All the data and pointer Registers */
-       R1 = R0;
-       R2 = R0;
-       R3 = R0;
-       R4 = R0;
-       R5 = R0;
-       R6 = R0;
-
-       P0 = R0;
-       P1 = R0;
-       P2 = R0;
-       P3 = R0;
-       P4 = R0;
-       P5 = R0;
-
-       LC0 = r0;
-       LC1 = r0;
-       L0 = r0;
-       L1 = r0;
-       L2 = r0;
-       L3 = r0;
-
-       /* Clear Out All the DAG Registers */
-       B0 = r0;
-       B1 = r0;
-       B2 = r0;
-       B3 = r0;
-
-       I0 = r0;
-       I1 = r0;
-       I2 = r0;
-       I3 = r0;
-
-       M0 = r0;
-       M1 = r0;
-       M2 = r0;
-       M3 = r0;
-
-       trace_buffer_init(p0,r0);
-       P0 = R1;
-       R0 = R1;
-
-       /* Turn off the icache */
-       p0.l = LO(IMEM_CONTROL);
-       p0.h = HI(IMEM_CONTROL);
-       R1 = [p0];
-       R0 = ~ENICPLB;
-       R0 = R0 & R1;
-
-#if ANOMALY_05000125
-       CLI R2;
-       SSYNC;
-#endif
-       [p0] = R0;
-       SSYNC;
-#if ANOMALY_05000125
-       STI R2;
-#endif
-
-       /* Turn off the dcache */
-       p0.l = LO(DMEM_CONTROL);
-       p0.h = HI(DMEM_CONTROL);
-       R1 = [p0];
-       R0 = ~ENDCPLB;
-       R0 = R0 & R1;
-
-       /* Anomaly 05000125 */
-#if ANOMALY_05000125
-       CLI R2;
-       SSYNC;
-#endif
-       [p0] = R0;
-       SSYNC;
-#if ANOMALY_05000125
-       STI R2;
-#endif
-
-       /* Initialise UART - when booting from u-boot, the UART is not disabled
-        * so if we dont initalize here, our serial console gets hosed */
-       p0.h = hi(BFIN_UART_LCR);
-       p0.l = lo(BFIN_UART_LCR);
-       r0 = 0x0(Z);
-       w[p0] = r0.L;   /* To enable DLL writes */
-       ssync;
-
-       p0.h = hi(BFIN_UART_DLL);
-       p0.l = lo(BFIN_UART_DLL);
-       r0 = 0x0(Z);
-       w[p0] = r0.L;
-       ssync;
-
-       p0.h = hi(BFIN_UART_DLH);
-       p0.l = lo(BFIN_UART_DLH);
-       r0 = 0x00(Z);
-       w[p0] = r0.L;
-       ssync;
-
-       p0.h = hi(BFIN_UART_GCTL);
-       p0.l = lo(BFIN_UART_GCTL);
-       r0 = 0x0(Z);
-       w[p0] = r0.L;   /* To enable UART clock */
-       ssync;
-
-       /* Initialize stack pointer */
-       sp.l = lo(INITIAL_STACK);
-       sp.h = hi(INITIAL_STACK);
-       fp = sp;
-       usp = sp;
-
-#ifdef CONFIG_EARLY_PRINTK
-       SP += -12;
-       call _init_early_exception_vectors;
-       SP += 12;
-#endif
-
-       /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
-       call _bf53x_relocate_l1_mem;
-#if CONFIG_BFIN_KERNEL_CLOCK
-       call _start_dma_code;
-#endif
-
-       /* Code for initializing Async memory banks */
-
-       p2.h = hi(EBIU_AMBCTL1);
-       p2.l = lo(EBIU_AMBCTL1);
-       r0.h = hi(AMBCTL1VAL);
-       r0.l = lo(AMBCTL1VAL);
-       [p2] = r0;
-       ssync;
-
-       p2.h = hi(EBIU_AMBCTL0);
-       p2.l = lo(EBIU_AMBCTL0);
-       r0.h = hi(AMBCTL0VAL);
-       r0.l = lo(AMBCTL0VAL);
-       [p2] = r0;
-       ssync;
-
-       p2.h = hi(EBIU_AMGCTL);
-       p2.l = lo(EBIU_AMGCTL);
-       r0 = AMGCTLVAL;
-       w[p2] = r0;
-       ssync;
-
-       /* This section keeps the processor in supervisor mode
-        * during kernel boot.  Switches to user mode at end of boot.
-        * See page 3-9 of Hardware Reference manual for documentation.
-        */
-
-       /* EVT15 = _real_start */
-
-       p0.l = lo(EVT15);
-       p0.h = hi(EVT15);
-       p1.l = _real_start;
-       p1.h = _real_start;
-       [p0] = p1;
-       csync;
-
-       p0.l = lo(IMASK);
-       p0.h = hi(IMASK);
-       p1.l = IMASK_IVG15;
-       p1.h = 0x0;
-       [p0] = p1;
-       csync;
-
-       raise 15;
-       p0.l = .LWAIT_HERE;
-       p0.h = .LWAIT_HERE;
-       reti = p0;
-#if ANOMALY_05000281
-       nop; nop; nop;
-#endif
-       rti;
-
-.LWAIT_HERE:
-       jump .LWAIT_HERE;
-ENDPROC(__start)
-
-ENTRY(_real_start)
-       [ -- sp ] = reti;
-       p0.l = lo(WDOGA_CTL);
-       p0.h = hi(WDOGA_CTL);
-       r0 = 0xAD6(z);
-       w[p0] = r0;     /* watchdog off for now */
-       ssync;
-
-       /* Code update for BSS size == 0
-        * Zero out the bss region.
-        */
-
-       p1.l = ___bss_start;
-       p1.h = ___bss_start;
-       p2.l = ___bss_stop;
-       p2.h = ___bss_stop;
-       r0 = 0;
-       p2 -= p1;
-       lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2;
-.L_clear_bss:
-       B[p1++] = r0;
-
-       /* In case there is a NULL pointer reference
-        * Zero out region before stext
-        */
-
-       p1.l = 0x0;
-       p1.h = 0x0;
-       r0.l = __stext;
-       r0.h = __stext;
-       r0 = r0 >> 1;
-       p2 = r0;
-       r0 = 0;
-       lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2;
-.L_clear_zero:
-       W[p1++] = r0;
-
-       /* pass the uboot arguments to the global value command line */
-       R0 = R7;
-       call _cmdline_init;
-
-       p1.l = __rambase;
-       p1.h = __rambase;
-       r0.l = __sdata;
-       r0.h = __sdata;
-       [p1] = r0;
-
-       p1.l = __ramstart;
-       p1.h = __ramstart;
-       p3.l = ___bss_stop;
-       p3.h = ___bss_stop;
-
-       r1 = p3;
-       [p1] = r1;
-
-       /*
-        * load the current thread pointer and stack
-        */
-       r1.l = _init_thread_union;
-       r1.h = _init_thread_union;
-
-       r2.l = 0x2000;
-       r2.h = 0x0000;
-       r1 = r1 + r2;
-       sp = r1;
-       usp = sp;
-       fp = sp;
-       jump.l _start_kernel;
-ENDPROC(_real_start)
-
-__FINIT
-
 .section .l1.text
-#if CONFIG_BFIN_KERNEL_CLOCK
+#ifdef CONFIG_BFIN_KERNEL_CLOCK
 ENTRY(_start_dma_code)
        p0.h = hi(SICA_IWR0);
        p0.l = lo(SICA_IWR0);
index 09b541b..9d2f233 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/irq.h>
 #include <asm/blackfin.h>
 
-void program_IAR(void)
+void __init program_IAR(void)
 {
        /* Program the IAR0 Register with the configured priority */
        bfin_write_SICA_IAR0(((CONFIG_IRQ_PLL_WAKEUP - 7) << IRQ_PLL_WAKEUP_POS) |
index 422bfee..e6ed57c 100644 (file)
@@ -3,9 +3,10 @@
 #
 
 obj-y := \
-       cache.o cacheinit.o entry.o \
-       interrupt.o lock.o irqpanic.o arch_checks.o ints-priority.o
+       cache.o entry.o head.o \
+       interrupt.o irqpanic.o arch_checks.o ints-priority.o
 
+obj-$(CONFIG_BFIN_ICACHE_LOCK) += lock.o
 obj-$(CONFIG_PM)          += pm.o dpmc_modes.o
 obj-$(CONFIG_CPU_FREQ)    += cpufreq.o
 obj-$(CONFIG_CPU_VOLTAGE) += dpmc.o
index f9160d8..5986758 100644 (file)
@@ -27,6 +27,7 @@
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <asm/fixed_code.h>
 #include <asm/mach/anomaly.h>
 #include <asm/mach-common/clocks.h>
 
 # endif
 
 #endif /* CONFIG_BFIN_KERNEL_CLOCK */
+
+#if CONFIG_BOOT_LOAD < FIXED_CODE_END
+# error "The kernel load address must be after the fixed code section"
+#endif
+
+#if (CONFIG_BOOT_LOAD & 0x3)
+# error "The kernel load address must be 4 byte aligned"
+#endif
index 0521b15..85f8c79 100644 (file)
 #include <asm/cache.h>
 
 .text
-.align 2
-ENTRY(_cache_invalidate)
-
-       /*
-        * Icache or DcacheA or DcacheB Invalidation
-        * or any combination thereof
-        * R0 has bits
-        * CPLB_ENABLE_ICACHE_P,CPLB_ENABLE_DCACHE_P,CPLB_ENABLE_DCACHE2_P
-        * set as required
-        */
-       [--SP] = R7;
-
-       R7 = R0;
-       CC = BITTST(R7,CPLB_ENABLE_ICACHE_P);
-       IF !CC JUMP .Lno_icache;
-       [--SP] = RETS;
-       CALL _icache_invalidate;
-       RETS = [SP++];
-.Lno_icache:
-       CC = BITTST(R7,CPLB_ENABLE_DCACHE_P);
-       IF !CC JUMP .Lno_dcache_a;
-       R0 = 0;         /* specifies bank A */
-       [--SP] = RETS;
-       CALL _dcache_invalidate;
-       RETS = [SP++];
-.Lno_dcache_a:
-       CC = BITTST(R7,CPLB_ENABLE_DCACHE2_P);
-       IF !CC JUMP .Lno_dcache_b;
-       R0 = 0;
-       BITSET(R0, 23);         /* specifies bank B */
-       [--SP] = RETS;
-       CALL  _dcache_invalidate;
-       RETS = [SP++];
-.Lno_dcache_b:
-       R7 = [SP++];
-       RTS;
-ENDPROC(_cache_invalidate)
-
-/* Invalidate the Entire Instruction cache by
- * disabling IMC bit
- */
-ENTRY(_icache_invalidate)
-ENTRY(_invalidate_entire_icache)
-       [--SP] = ( R7:5);
-
-       P0.L = LO(IMEM_CONTROL);
-       P0.H = HI(IMEM_CONTROL);
-       R7 = [P0];
-
-       /* Clear the IMC bit , All valid bits in the instruction
-        * cache are set to the invalid state
-        */
-       BITCLR(R7,IMC_P);
-       CLI R6;
-       SSYNC;          /* SSYNC required before invalidating cache. */
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-
-       /* Configures the instruction cache agian */
-       R6 = (IMC | ENICPLB);
-       R7 = R7 | R6;
-
-       CLI R6;
-       SSYNC;          /* SSYNC required before writing to IMEM_CONTROL. */
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-
-       ( R7:5) = [SP++];
-       RTS;
-ENDPROC(_invalidate_entire_icache)
-ENDPROC(_icache_invalidate)
 
 /*
  * blackfin_cache_flush_range(start, end)
@@ -190,46 +115,6 @@ ENTRY(_blackfin_dcache_invalidate_range)
        RTS;
 ENDPROC(_blackfin_dcache_invalidate_range)
 
-/* Invalidate the Entire Data cache by
- * clearing DMC[1:0] bits
- */
-ENTRY(_invalidate_entire_dcache)
-ENTRY(_dcache_invalidate)
-       [--SP] = ( R7:6);
-
-       P0.L = LO(DMEM_CONTROL);
-       P0.H = HI(DMEM_CONTROL);
-       R7 = [P0];
-
-       /* Clear the DMC[1:0] bits, All valid bits in the data
-        * cache are set to the invalid state
-        */
-       BITCLR(R7,DMC0_P);
-       BITCLR(R7,DMC1_P);
-       CLI R6;
-       SSYNC;          /* SSYNC required before writing to DMEM_CONTROL. */
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-
-       /* Configures the data cache again */
-
-       R6 = DMEM_CNTR;
-       R7 = R7 | R6;
-
-       CLI R6;
-       SSYNC;          /* SSYNC required before writing to DMEM_CONTROL. */
-       .align 8;
-       [P0] = R7;
-       SSYNC;
-       STI R6;
-
-       ( R7:6) = [SP++];
-       RTS;
-ENDPROC(_dcache_invalidate)
-ENDPROC(_invalidate_entire_dcache)
-
 ENTRY(_blackfin_dcache_flush_range)
        R2 = -L1_CACHE_BYTES;
        R2 = R0 & R2;
diff --git a/arch/blackfin/mach-common/cacheinit.S b/arch/blackfin/mach-common/cacheinit.S
deleted file mode 100644 (file)
index 22fada0..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * File:         arch/blackfin/mach-common/cacheinit.S
- * Based on:
- * Author:       LG Soft India
- *
- * Created:      ?
- * Description:  cache initialization
- *
- * Modified:
- *               Copyright 2004-2006 Analog Devices Inc.
- *
- * Bugs:         Enter bugs at http://blackfin.uclinux.org/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see the file COPYING, or write
- * to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-/* This function sets up the data and instruction cache. The
- * tables like icplb table, dcplb table and Page Descriptor table
- * are defined in cplbtab.h. You can configure those tables for
- * your suitable requirements
- */
-
-#include <linux/linkage.h>
-#include <asm/blackfin.h>
-
-.text
-
-#if ANOMALY_05000125
-#if defined(CONFIG_BFIN_ICACHE)
-ENTRY(_bfin_write_IMEM_CONTROL)
-
-       /* Enable Instruction Cache */
-       P0.l = LO(IMEM_CONTROL);
-       P0.h = HI(IMEM_CONTROL);
-
-       /* Anomaly 05000125 */
-       CLI R1;
-       SSYNC;          /* SSYNC required before writing to IMEM_CONTROL. */
-       .align 8;
-       [P0] = R0;
-       SSYNC;
-       STI R1;
-       RTS;
-
-ENDPROC(_bfin_write_IMEM_CONTROL)
-#endif
-
-#if defined(CONFIG_BFIN_DCACHE)
-ENTRY(_bfin_write_DMEM_CONTROL)
-       P0.l = LO(DMEM_CONTROL);
-       P0.h = HI(DMEM_CONTROL);
-
-       CLI R1;
-       SSYNC;          /* SSYNC required before writing to DMEM_CONTROL. */
-       .align 8;
-       [P0] = R0;
-       SSYNC;
-       STI R1;
-       RTS;
-
-ENDPROC(_bfin_write_DMEM_CONTROL)
-#endif
-
-#endif
index 5e3f1d8..838b0b2 100644 (file)
@@ -78,62 +78,6 @@ ENTRY(_hibernate_mode)
        jump .Lforever;
 ENDPROC(_hibernate_mode)
 
-ENTRY(_deep_sleep)
-       [--SP] = ( R7:0, P5:0 );
-       [--SP] =  RETS;
-
-       CLI R4;
-
-       R0 = IWR_ENABLE(0);
-       R1 = IWR_DISABLE_ALL;
-       R2 = IWR_DISABLE_ALL;
-
-       call _set_sic_iwr;
-
-       call _set_dram_srfs;
-
-       /* Clear all the interrupts,bits sticky */
-       R0 = 0xFFFF (Z);
-       call _set_rtc_istat
-
-       P0.H = hi(PLL_CTL);
-       P0.L = lo(PLL_CTL);
-       R0 = W[P0](z);
-       BITSET (R0, 5);
-       W[P0] = R0.L;
-
-       call _test_pll_locked;
-
-       SSYNC;
-       IDLE;
-
-       call _unset_dram_srfs;
-
-       call _test_pll_locked;
-
-       R0 = IWR_ENABLE(0);
-       R1 = IWR_DISABLE_ALL;
-       R2 = IWR_DISABLE_ALL;
-
-       call _set_sic_iwr;
-
-       P0.H = hi(PLL_CTL);
-       P0.L = lo(PLL_CTL);
-       R0 = w[p0](z);
-       BITCLR (R0, 3);
-       BITCLR (R0, 5);
-       BITCLR (R0, 8);
-       w[p0] = R0;
-       IDLE;
-       call _test_pll_locked;
-
-       STI R4;
-
-       RETS = [SP++];
-       ( R7:0, P5:0 ) = [SP++];
-       RTS;
-ENDPROC(_deep_sleep)
-
 ENTRY(_sleep_deeper)
        [--SP] = ( R7:0, P5:0 );
        [--SP] =  RETS;
index eceb484..117c01c 100644 (file)
@@ -158,14 +158,16 @@ ENTRY(_ex_single_step)
        cc = r7 == r6;
        if cc jump _bfin_return_from_exception;
 
+#ifdef CONFIG_KGDB
        /* Don't do single step in hardware exception handler */
         p5.l = lo(IPEND);
         p5.h = hi(IPEND);
        r6 = [p5];
+       cc = bittst(r6, 4);
+       if cc jump _bfin_return_from_exception;
        cc = bittst(r6, 5);
        if cc jump _bfin_return_from_exception;
 
-#ifdef CONFIG_KGDB
        /* skip single step if current interrupt priority is higher than
         * that of the first instruction, from which gdb starts single step */
        r6 >>= 6;
@@ -186,17 +188,27 @@ ENTRY(_ex_single_step)
        if cc jump .Ldo_single_step;
        r6 += -1;
        cc = r6 < r7;
-       if cc jump _bfin_return_from_exception;
+       if cc jump 1f;
 .Ldo_single_step:
-#endif
-
+#else
        /* If we were in user mode, do the single step normally.  */
+       p5.l = lo(IPEND);
+       p5.h = hi(IPEND);
        r6 = [p5];
        r7 = 0xffe0 (z);
        r7 = r7 & r6;
        cc = r7 == 0;
-       if cc jump 1f;
+       if !cc jump 1f;
+#endif
 
+       /* Single stepping only a single instruction, so clear the trace
+        * bit here.  */
+       r7 = syscfg;
+       bitclr (r7, 0);
+       syscfg = R7;
+       jump _ex_trap_c;
+
+1:
        /*
         * We were in an interrupt handler.  By convention, all of them save
         * SYSCFG with their first instruction, so by checking whether our
@@ -224,15 +236,11 @@ ENTRY(_ex_single_step)
        cc = R7 == R6;
        if !cc jump _bfin_return_from_exception;
 
-1:
-       /* Single stepping only a single instruction, so clear the trace
-        * bit here.  */
        r7 = syscfg;
        bitclr (r7, 0);
        syscfg = R7;
 
-       jump _ex_trap_c;
-
+       /* Fall through to _bfin_return_from_exception.  */
 ENDPROC(_ex_single_step)
 
 ENTRY(_bfin_return_from_exception)
@@ -1414,6 +1422,12 @@ ENTRY(_sys_call_table)
        .long _sys_semtimedop
        .long _sys_timerfd_settime
        .long _sys_timerfd_gettime
+       .long _sys_signalfd4            /* 360 */
+       .long _sys_eventfd2
+       .long _sys_epoll_create1
+       .long _sys_dup3
+       .long _sys_pipe2
+       .long _sys_inotify_init1        /* 365 */
 
        .rept NR_syscalls-(.-_sys_call_table)/4
        .long _sys_ni_syscall
diff --git a/arch/blackfin/mach-common/head.S b/arch/blackfin/mach-common/head.S
new file mode 100644 (file)
index 0000000..191b4e9
--- /dev/null
@@ -0,0 +1,207 @@
+/*
+ * Common Blackfin startup code
+ *
+ * Copyright 2004-2008 Analog Devices Inc.
+ *
+ * Enter bugs at http://blackfin.uclinux.org/
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <linux/linkage.h>
+#include <linux/init.h>
+#include <asm/blackfin.h>
+#include <asm/thread_info.h>
+#include <asm/trace.h>
+
+__INIT
+
+#define INITIAL_STACK  (L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12)
+
+ENTRY(__start)
+       /* R0: argument of command line string, passed from uboot, save it */
+       R7 = R0;
+       /* Enable Cycle Counter and Nesting Of Interrupts */
+#ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES
+       R0 = SYSCFG_SNEN;
+#else
+       R0 = SYSCFG_SNEN | SYSCFG_CCEN;
+#endif
+       SYSCFG = R0;
+       R0 = 0;
+
+       /* Clear Out All the data and pointer Registers */
+       R1 = R0;
+       R2 = R0;
+       R3 = R0;
+       R4 = R0;
+       R5 = R0;
+       R6 = R0;
+
+       P0 = R0;
+       P1 = R0;
+       P2 = R0;
+       P3 = R0;
+       P4 = R0;
+       P5 = R0;
+
+       LC0 = r0;
+       LC1 = r0;
+       L0 = r0;
+       L1 = r0;
+       L2 = r0;
+       L3 = r0;
+
+       /* Clear Out All the DAG Registers */
+       B0 = r0;
+       B1 = r0;
+       B2 = r0;
+       B3 = r0;
+
+       I0 = r0;
+       I1 = r0;
+       I2 = r0;
+       I3 = r0;
+
+       M0 = r0;
+       M1 = r0;
+       M2 = r0;
+       M3 = r0;
+
+       trace_buffer_init(p0,r0);
+       P0 = R1;
+       R0 = R1;
+
+       /* Turn off the icache */
+       p0.l = LO(IMEM_CONTROL);
+       p0.h = HI(IMEM_CONTROL);
+       R1 = [p0];
+       R0 = ~ENICPLB;
+       R0 = R0 & R1;
+       [p0] = R0;
+       SSYNC;
+
+       /* Turn off the dcache */
+       p0.l = LO(DMEM_CONTROL);
+       p0.h = HI(DMEM_CONTROL);
+       R1 = [p0];
+       R0 = ~ENDCPLB;
+       R0 = R0 & R1;
+       [p0] = R0;
+       SSYNC;
+
+       /* Save RETX, in case of doublefault */
+       p0.l = ___retx;
+       p0.h = ___retx;
+       R0 = RETX;
+       [P0] = R0;
+
+       /* Initialize stack pointer */
+       sp.l = lo(INITIAL_STACK);
+       sp.h = hi(INITIAL_STACK);
+       fp = sp;
+       usp = sp;
+
+#ifdef CONFIG_EARLY_PRINTK
+       call _init_early_exception_vectors;
+#endif
+
+       /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
+       call _bf53x_relocate_l1_mem;
+#ifdef CONFIG_BFIN_KERNEL_CLOCK
+       call _start_dma_code;
+#endif
+
+       /* This section keeps the processor in supervisor mode
+        * during kernel boot.  Switches to user mode at end of boot.
+        * See page 3-9 of Hardware Reference manual for documentation.
+        */
+
+       /* EVT15 = _real_start */
+
+       p0.l = lo(EVT15);
+       p0.h = hi(EVT15);
+       p1.l = _real_start;
+       p1.h = _real_start;
+       [p0] = p1;
+       csync;
+
+       p0.l = lo(IMASK);
+       p0.h = hi(IMASK);
+       p1.l = IMASK_IVG15;
+       p1.h = 0x0;
+       [p0] = p1;
+       csync;
+
+       raise 15;
+       p0.l = .LWAIT_HERE;
+       p0.h = .LWAIT_HERE;
+       reti = p0;
+#if ANOMALY_05000281
+       nop; nop; nop;
+#endif
+       rti;
+
+.LWAIT_HERE:
+       jump .LWAIT_HERE;
+ENDPROC(__start)
+
+/* A little BF561 glue ... */
+#ifndef WDOG_CTL
+# define WDOG_CTL WDOGA_CTL
+#endif
+
+ENTRY(_real_start)
+       /* Enable nested interrupts */
+       [--sp] = reti;
+
+       /* watchdog off for now */
+       p0.l = lo(WDOG_CTL);
+       p0.h = hi(WDOG_CTL);
+       r0 = 0xAD6(z);
+       w[p0] = r0;
+       ssync;
+
+       /* Zero out the bss region
+        * Note: this will fail if bss is 0 bytes ...
+        */
+       r0 = 0 (z);
+       r1.l = ___bss_start;
+       r1.h = ___bss_start;
+       r2.l = ___bss_stop;
+       r2.h = ___bss_stop;
+       r2 = r2 - r1;
+       r2 >>= 2;
+       p1 = r1;
+       p2 = r2;
+       lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2;
+.L_clear_bss:
+       [p1++] = r0;
+
+       /* In case there is a NULL pointer reference,
+        * zero out region before stext
+        */
+       p1 = r0;
+       r2.l = __stext;
+       r2.h = __stext;
+       r2 >>= 2;
+       p2 = r2;
+       lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2;
+.L_clear_zero:
+       [p1++] = r0;
+
+       /* Pass the u-boot arguments to the global value command line */
+       R0 = R7;
+       call _cmdline_init;
+
+       /* Load the current thread pointer and stack */
+       sp.l = _init_thread_union;
+       sp.h = _init_thread_union;
+       p1 = THREAD_SIZE (z);
+       sp = sp + p1;
+       usp = sp;
+       fp = sp;
+       jump.l _start_kernel;
+ENDPROC(_real_start)
+
+__FINIT
index 64d7461..62f8883 100644 (file)
@@ -71,6 +71,7 @@ atomic_t num_spurious;
 
 #ifdef CONFIG_PM
 unsigned long bfin_sic_iwr[3]; /* Up to 3 SIC_IWRx registers */
+unsigned vr_wakeup;
 #endif
 
 struct ivgx {
@@ -184,17 +185,56 @@ static void bfin_internal_unmask_irq(unsigned int irq)
 #ifdef CONFIG_PM
 int bfin_internal_set_wake(unsigned int irq, unsigned int state)
 {
-       unsigned bank, bit;
+       unsigned bank, bit, wakeup = 0;
        unsigned long flags;
        bank = SIC_SYSIRQ(irq) / 32;
        bit = SIC_SYSIRQ(irq) % 32;
 
+       switch (irq) {
+#ifdef IRQ_RTC
+       case IRQ_RTC:
+       wakeup |= WAKE;
+       break;
+#endif
+#ifdef IRQ_CAN0_RX
+       case IRQ_CAN0_RX:
+       wakeup |= CANWE;
+       break;
+#endif
+#ifdef IRQ_CAN1_RX
+       case IRQ_CAN1_RX:
+       wakeup |= CANWE;
+       break;
+#endif
+#ifdef IRQ_USB_INT0
+       case IRQ_USB_INT0:
+       wakeup |= USBWE;
+       break;
+#endif
+#ifdef IRQ_KEY
+       case IRQ_KEY:
+       wakeup |= KPADWE;
+       break;
+#endif
+#ifdef IRQ_CNT
+       case IRQ_CNT:
+       wakeup |= ROTWE;
+       break;
+#endif
+       default:
+       break;
+       }
+
        local_irq_save(flags);
 
-       if (state)
+       if (state) {
                bfin_sic_iwr[bank] |= (1 << bit);
-       else
+               vr_wakeup  |= wakeup;
+
+       } else {
                bfin_sic_iwr[bank] &= ~(1 << bit);
+               vr_wakeup  &= ~wakeup;
+       }
 
        local_irq_restore(flags);
 
@@ -943,6 +983,11 @@ int __init init_arch_irq(void)
 
        local_irq_disable();
 
+#if defined(CONFIG_BF527) || defined(CONFIG_BF536) || defined(CONFIG_BF537)
+       /* Clear EMAC Interrupt Status bits so we can demux it later */
+       bfin_write_EMAC_SYSTAT(-1);
+#endif
+
 #ifdef CONFIG_BF54x
 # ifdef CONFIG_PINTx_REASSIGN
        pint[0]->assign = CONFIG_PINT0_ASSIGN;
@@ -1028,13 +1073,22 @@ int __init init_arch_irq(void)
            IMASK_IVG10 | IMASK_IVG9 | IMASK_IVG8 | IMASK_IVG7 | IMASK_IVGHW;
 
 #if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561)
-       bfin_write_SIC_IWR0(IWR_ENABLE_ALL);
-       bfin_write_SIC_IWR1(IWR_ENABLE_ALL);
+       bfin_write_SIC_IWR0(IWR_DISABLE_ALL);
+#if defined(CONFIG_BF52x)
+       /* BF52x system reset does not properly reset SIC_IWR1 which
+        * will screw up the bootrom as it relies on MDMA0/1 waking it
+        * up from IDLE instructions.  See this report for more info:
+        * http://blackfin.uclinux.org/gf/tracker/4323
+        */
+       bfin_write_SIC_IWR1(IWR_ENABLE(10) | IWR_ENABLE(11));
+#else
+       bfin_write_SIC_IWR1(IWR_DISABLE_ALL);
+#endif
 # ifdef CONFIG_BF54x
-       bfin_write_SIC_IWR2(IWR_ENABLE_ALL);
+       bfin_write_SIC_IWR2(IWR_DISABLE_ALL);
 # endif
 #else
-       bfin_write_SIC_IWR(IWR_ENABLE_ALL);
+       bfin_write_SIC_IWR(IWR_DISABLE_ALL);
 #endif
 
        return 0;
index 30b887e..9daf012 100644 (file)
  */
 
 #include <linux/linkage.h>
-#include <asm/cplb.h>
 #include <asm/blackfin.h>
 
 .text
 
-#ifdef CONFIG_BFIN_ICACHE_LOCK
-
 /* When you come here, it is assumed that
  * R0 - Which way to be locked
  */
@@ -189,18 +186,38 @@ ENTRY(_cache_lock)
        RTS;
 ENDPROC(_cache_lock)
 
-#endif /* BFIN_ICACHE_LOCK */
-
-/* Return the ILOC bits of IMEM_CONTROL
+/* Invalidate the Entire Instruction cache by
+ * disabling IMC bit
  */
+ENTRY(_invalidate_entire_icache)
+       [--SP] = ( R7:5);
 
-ENTRY(_read_iloc)
-       P1.H = HI(IMEM_CONTROL);
-       P1.L = LO(IMEM_CONTROL);
-       R1 = 0xF;
-       R0 = [P1];
-       R0 = R0 >> 3;
-       R0 = R0 & R1;
+       P0.L = LO(IMEM_CONTROL);
+       P0.H = HI(IMEM_CONTROL);
+       R7 = [P0];
+
+       /* Clear the IMC bit , All valid bits in the instruction
+        * cache are set to the invalid state
+        */
+       BITCLR(R7,IMC_P);
+       CLI R6;
+       SSYNC;          /* SSYNC required before invalidating cache. */
+       .align 8;
+       [P0] = R7;
+       SSYNC;
+       STI R6;
+
+       /* Configures the instruction cache agian */
+       R6 = (IMC | ENICPLB);
+       R7 = R7 | R6;
+
+       CLI R6;
+       SSYNC;          /* SSYNC required before writing to IMEM_CONTROL. */
+       .align 8;
+       [P0] = R7;
+       SSYNC;
+       STI R6;
 
+       ( R7:5) = [SP++];
        RTS;
-ENDPROC(_read_iloc)
+ENDPROC(_invalidate_entire_icache)
index 4fe6a23..e28c6af 100644 (file)
@@ -83,13 +83,22 @@ void bfin_pm_suspend_standby_enter(void)
        bfin_pm_standby_restore();
 
 #if defined(CONFIG_BF54x) || defined(CONFIG_BF52x)  || defined(CONFIG_BF561)
-       bfin_write_SIC_IWR0(IWR_ENABLE_ALL);
-       bfin_write_SIC_IWR1(IWR_ENABLE_ALL);
+       bfin_write_SIC_IWR0(IWR_DISABLE_ALL);
+#if defined(CONFIG_BF52x)
+       /* BF52x system reset does not properly reset SIC_IWR1 which
+        * will screw up the bootrom as it relies on MDMA0/1 waking it
+        * up from IDLE instructions.  See this report for more info:
+        * http://blackfin.uclinux.org/gf/tracker/4323
+        */
+       bfin_write_SIC_IWR1(IWR_ENABLE(10) | IWR_ENABLE(11));
+#else
+       bfin_write_SIC_IWR1(IWR_DISABLE_ALL);
+#endif
 # ifdef CONFIG_BF54x
-       bfin_write_SIC_IWR2(IWR_ENABLE_ALL);
+       bfin_write_SIC_IWR2(IWR_DISABLE_ALL);
 # endif
 #else
-       bfin_write_SIC_IWR(IWR_ENABLE_ALL);
+       bfin_write_SIC_IWR(IWR_DISABLE_ALL);
 #endif
 
        local_irq_restore(flags);
@@ -229,28 +238,12 @@ int bfin_pm_suspend_mem_enter(void)
        wakeup = bfin_read_VR_CTL() & ~FREQ;
        wakeup |= SCKELOW;
 
-       /* FIXME: merge this somehow with set_irq_wake */
-#ifdef CONFIG_PM_BFIN_WAKE_RTC
-       wakeup |= WAKE;
-#endif
 #ifdef CONFIG_PM_BFIN_WAKE_PH6
        wakeup |= PHYWE;
 #endif
-#ifdef CONFIG_PM_BFIN_WAKE_CAN
-       wakeup |= CANWE;
-#endif
 #ifdef CONFIG_PM_BFIN_WAKE_GP
        wakeup |= GPWE;
 #endif
-#ifdef CONFIG_PM_BFIN_WAKE_USB
-       wakeup |= USBWE;
-#endif
-#ifdef CONFIG_PM_BFIN_WAKE_KEYPAD
-       wakeup |= KPADWE;
-#endif
-#ifdef CONFIG_PM_BFIN_WAKE_ROTARY
-       wakeup |= ROTWE;
-#endif
 
        local_irq_save(flags);
 
@@ -268,7 +261,7 @@ int bfin_pm_suspend_mem_enter(void)
        icache_disable();
        bf53x_suspend_l1_mem(memptr);
 
-       do_hibernate(wakeup);   /* Goodbye */
+       do_hibernate(wakeup | vr_wakeup);       /* Goodbye */
 
        bf53x_resume_l1_mem(memptr);
 
index 5af3c31..9d2be43 100644 (file)
@@ -66,7 +66,7 @@ static struct sram_piece free_l1_data_B_sram_head, used_l1_data_B_sram_head;
 static struct sram_piece free_l1_inst_sram_head, used_l1_inst_sram_head;
 #endif
 
-#ifdef L2_LENGTH
+#if L2_LENGTH != 0
 static struct sram_piece free_l2_sram_head, used_l2_sram_head;
 #endif
 
@@ -175,7 +175,7 @@ static void __init l1_inst_sram_init(void)
 
 static void __init l2_sram_init(void)
 {
-#ifdef L2_LENGTH
+#if L2_LENGTH != 0
        free_l2_sram_head.next =
                kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
        if (!free_l2_sram_head.next) {
@@ -367,7 +367,7 @@ int sram_free(const void *addr)
                 && addr < (void *)(L1_DATA_B_START + L1_DATA_B_LENGTH))
                return l1_data_B_sram_free(addr);
 #endif
-#ifdef L2_LENGTH
+#if L2_LENGTH != 0
        else if (addr >= (void *)L2_START
                 && addr < (void *)(L2_START + L2_LENGTH))
                return l2_sram_free(addr);
@@ -604,7 +604,7 @@ int l1sram_free(const void *addr)
 
 void *l2_sram_alloc(size_t size)
 {
-#ifdef L2_LENGTH
+#if L2_LENGTH != 0
        unsigned flags;
        void *addr;
 
@@ -640,7 +640,7 @@ EXPORT_SYMBOL(l2_sram_zalloc);
 
 int l2_sram_free(const void *addr)
 {
-#ifdef L2_LENGTH
+#if L2_LENGTH != 0
        unsigned flags;
        int ret;
 
@@ -779,7 +779,7 @@ static int sram_proc_read(char *buf, char **start, off_t offset, int count,
                        &free_l1_inst_sram_head, &used_l1_inst_sram_head))
                goto not_done;
 #endif
-#ifdef L2_LENGTH
+#if L2_LENGTH != 0
        if (_sram_proc_read(buf, &len, count, "L2",
                        &free_l2_sram_head, &used_l2_sram_head))
                goto not_done;
index 541be83..e1d58f8 100644 (file)
@@ -9,7 +9,7 @@
 /* Maximum address we can use for the control code buffer */
 #define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE
 
-#define KEXEC_CONTROL_CODE_SIZE (8192 + 8192 + 4096)
+#define KEXEC_CONTROL_PAGE_SIZE (8192 + 8192 + 4096)
 
 /* The native architecture */
 #define KEXEC_ARCH KEXEC_ARCH_IA_64
index acdcdc6..3736d9b 100644 (file)
@@ -22,7 +22,7 @@
 #define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE
 #endif
 
-#define KEXEC_CONTROL_CODE_SIZE 4096
+#define KEXEC_CONTROL_PAGE_SIZE 4096
 
 /* The native architecture */
 #ifdef __powerpc64__
index cbaa341..ae63a96 100644 (file)
@@ -51,7 +51,7 @@ void default_machine_kexec(struct kimage *image)
                                                relocate_new_kernel_size);
 
        flush_icache_range(reboot_code_buffer,
-                               reboot_code_buffer + KEXEC_CONTROL_CODE_SIZE);
+                               reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
        printk(KERN_INFO "Bye!\n");
 
        /* now call it */
index f219c64..bb729b8 100644 (file)
@@ -31,7 +31,7 @@
 #define KEXEC_CONTROL_MEMORY_LIMIT (1UL<<31)
 
 /* Allocate one page for the pdp and the second for the code */
-#define KEXEC_CONTROL_CODE_SIZE 4096
+#define KEXEC_CONTROL_PAGE_SIZE 4096
 
 /* The native architecture */
 #define KEXEC_ARCH KEXEC_ARCH_S390
index 00f4260..765a5e1 100644 (file)
@@ -21,7 +21,7 @@
 /* Maximum address we can use for the control code buffer */
 #define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE
 
-#define KEXEC_CONTROL_CODE_SIZE        4096
+#define KEXEC_CONTROL_PAGE_SIZE        4096
 
 /* The native architecture */
 #define KEXEC_ARCH KEXEC_ARCH_SH
index ac2fb06..68d91c8 100644 (file)
@@ -951,9 +951,9 @@ config NUMA
          local memory controller of the CPU and add some more
          NUMA awareness to the kernel.
 
-         For i386 this is currently highly experimental and should be only
+         For 32-bit this is currently highly experimental and should be only
          used for kernel development. It might also cause boot failures.
-         For x86_64 this is recommended on all multiprocessor Opteron systems.
+         For 64-bit this is recommended on all multiprocessor Opteron systems.
          If the system is EM64T, you should say N unless your system is
          EM64T NUMA.
 
@@ -1263,7 +1263,7 @@ config KEXEC
          strongly in flux, so no good recommendation can be made.
 
 config CRASH_DUMP
-       bool "kernel crash dumps (EXPERIMENTAL)"
+       bool "kernel crash dumps"
        depends on X86_64 || (X86_32 && HIGHMEM)
        help
          Generate crash dump after being started by kexec.
index a34b998..616b804 100644 (file)
@@ -24,6 +24,8 @@
 #include <linux/edd.h>
 #include <asm/boot.h>
 #include <asm/setup.h>
+#include "bitops.h"
+#include <asm/cpufeature.h>
 
 /* Useful macros */
 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
@@ -242,6 +244,12 @@ int cmdline_find_option(const char *option, char *buffer, int bufsize);
 int cmdline_find_option_bool(const char *option);
 
 /* cpu.c, cpucheck.c */
+struct cpu_features {
+       int level;              /* Family, or 64 for x86-64 */
+       int model;
+       u32 flags[NCAPINTS];
+};
+extern struct cpu_features cpu;
 int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr);
 int validate_cpu(void);
 
index 92d6fd7..75298fe 100644 (file)
@@ -16,9 +16,6 @@
  */
 
 #include "boot.h"
-#include "bitops.h"
-#include <asm/cpufeature.h>
-
 #include "cpustr.h"
 
 static char *cpu_name(int level)
index 7804389..4b9ae7c 100644 (file)
 
 #ifdef _SETUP
 # include "boot.h"
-# include "bitops.h"
 #endif
 #include <linux/types.h>
-#include <asm/cpufeature.h>
 #include <asm/processor-flags.h>
 #include <asm/required-features.h>
 #include <asm/msr-index.h>
 
-struct cpu_features {
-       int level;              /* Family, or 64 for x86-64 */
-       int model;
-       u32 flags[NCAPINTS];
-};
-
-static struct cpu_features cpu;
+struct cpu_features cpu;
 static u32 cpu_vendor[3];
 static u32 err_flags[NCAPINTS];
 
index 2296164..197421d 100644 (file)
@@ -73,6 +73,11 @@ static void keyboard_set_repeat(void)
  */
 static void query_ist(void)
 {
+       /* Some older BIOSes apparently crash on this call, so filter
+          it from machines too old to have SpeedStep at all. */
+       if (cpu.level < 6)
+               return;
+
        asm("int $0x15"
            : "=a" (boot_params.ist_info.signature),
              "=b" (boot_params.ist_info.command),
index fa88a1d..bfd10fd 100644 (file)
@@ -97,6 +97,8 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
 #warning ACPI uses CMPXCHG, i486 and later hardware
 #endif
 
+static int acpi_mcfg_64bit_base_addr __initdata = FALSE;
+
 /* --------------------------------------------------------------------------
                               Boot-time Configuration
    -------------------------------------------------------------------------- */
@@ -158,6 +160,14 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size)
 struct acpi_mcfg_allocation *pci_mmcfg_config;
 int pci_mmcfg_config_num;
 
+static int __init acpi_mcfg_oem_check(struct acpi_table_mcfg *mcfg)
+{
+       if (!strcmp(mcfg->header.oem_id, "SGI"))
+               acpi_mcfg_64bit_base_addr = TRUE;
+
+       return 0;
+}
+
 int __init acpi_parse_mcfg(struct acpi_table_header *header)
 {
        struct acpi_table_mcfg *mcfg;
@@ -190,8 +200,12 @@ int __init acpi_parse_mcfg(struct acpi_table_header *header)
        }
 
        memcpy(pci_mmcfg_config, &mcfg[1], config_size);
+
+       acpi_mcfg_oem_check(mcfg);
+
        for (i = 0; i < pci_mmcfg_config_num; ++i) {
-               if (pci_mmcfg_config[i].address > 0xFFFFFFFF) {
+               if ((pci_mmcfg_config[i].address > 0xFFFFFFFF) &&
+                   !acpi_mcfg_64bit_base_addr) {
                        printk(KERN_ERR PREFIX
                               "MMCONFIG not in low 4GB of memory\n");
                        kfree(pci_mmcfg_config);
index fa2161d..81e5ab6 100644 (file)
@@ -20,7 +20,7 @@ unsigned long acpi_realmode_flags;
 /* address in low memory of the wakeup routine. */
 static unsigned long acpi_realmode;
 
-#ifdef CONFIG_64BIT
+#if defined(CONFIG_SMP) && defined(CONFIG_64BIT)
 static char temp_stack[10240];
 #endif
 
index 22d7d05..de39e1f 100644 (file)
@@ -101,16 +101,13 @@ static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd)
  */
 static int iommu_completion_wait(struct amd_iommu *iommu)
 {
-       int ret;
+       int ret, ready = 0;
+       unsigned status = 0;
        struct iommu_cmd cmd;
-       volatile u64 ready = 0;
-       unsigned long ready_phys = virt_to_phys(&ready);
        unsigned long i = 0;
 
        memset(&cmd, 0, sizeof(cmd));
-       cmd.data[0] = LOW_U32(ready_phys) | CMD_COMPL_WAIT_STORE_MASK;
-       cmd.data[1] = upper_32_bits(ready_phys);
-       cmd.data[2] = 1; /* value written to 'ready' */
+       cmd.data[0] = CMD_COMPL_WAIT_INT_MASK;
        CMD_SET_TYPE(&cmd, CMD_COMPL_WAIT);
 
        iommu->need_sync = 0;
@@ -122,9 +119,15 @@ static int iommu_completion_wait(struct amd_iommu *iommu)
 
        while (!ready && (i < EXIT_LOOP_COUNT)) {
                ++i;
-               cpu_relax();
+               /* wait for the bit to become one */
+               status = readl(iommu->mmio_base + MMIO_STATUS_OFFSET);
+               ready = status & MMIO_STATUS_COM_WAIT_INT_MASK;
        }
 
+       /* set bit back to zero */
+       status &= ~MMIO_STATUS_COM_WAIT_INT_MASK;
+       writel(status, iommu->mmio_base + MMIO_STATUS_OFFSET);
+
        if (unlikely((i == EXIT_LOOP_COUNT) && printk_ratelimit()))
                printk(KERN_WARNING "AMD IOMMU: Completion wait loop failed\n");
 
@@ -161,7 +164,7 @@ static int iommu_queue_inv_iommu_pages(struct amd_iommu *iommu,
        address &= PAGE_MASK;
        CMD_SET_TYPE(&cmd, CMD_INV_IOMMU_PAGES);
        cmd.data[1] |= domid;
-       cmd.data[2] = LOW_U32(address);
+       cmd.data[2] = lower_32_bits(address);
        cmd.data[3] = upper_32_bits(address);
        if (s) /* size bit - we flush more than one 4kb page */
                cmd.data[2] |= CMD_INV_IOMMU_PAGES_SIZE_MASK;
index d9a9da5..a69cc0f 100644 (file)
@@ -800,6 +800,21 @@ static int __init init_memory_definitions(struct acpi_table_header *table)
        return 0;
 }
 
+/*
+ * Init the device table to not allow DMA access for devices and
+ * suppress all page faults
+ */
+static void init_device_table(void)
+{
+       u16 devid;
+
+       for (devid = 0; devid <= amd_iommu_last_bdf; ++devid) {
+               set_dev_entry_bit(devid, DEV_ENTRY_VALID);
+               set_dev_entry_bit(devid, DEV_ENTRY_TRANSLATION);
+               set_dev_entry_bit(devid, DEV_ENTRY_NO_PAGE_FAULT);
+       }
+}
+
 /*
  * This function finally enables all IOMMUs found in the system after
  * they have been initialized
@@ -931,6 +946,9 @@ int __init amd_iommu_init(void)
        if (amd_iommu_pd_alloc_bitmap == NULL)
                goto free;
 
+       /* init the device table */
+       init_device_table();
+
        /*
         * let all alias entries point to itself
         */
@@ -954,15 +972,15 @@ int __init amd_iommu_init(void)
        if (acpi_table_parse("IVRS", init_memory_definitions) != 0)
                goto free;
 
-       ret = amd_iommu_init_dma_ops();
+       ret = sysdev_class_register(&amd_iommu_sysdev_class);
        if (ret)
                goto free;
 
-       ret = sysdev_class_register(&amd_iommu_sysdev_class);
+       ret = sysdev_register(&device_amd_iommu);
        if (ret)
                goto free;
 
-       ret = sysdev_register(&device_amd_iommu);
+       ret = amd_iommu_init_dma_ops();
        if (ret)
                goto free;
 
index 039a8d4..f88bd0d 100644 (file)
@@ -1454,8 +1454,6 @@ void disconnect_bsp_APIC(int virt_wire_setup)
        }
 }
 
-unsigned int __cpuinitdata maxcpus = NR_CPUS;
-
 void __cpuinit generic_processor_info(int apicid, int version)
 {
        int cpu;
@@ -1482,12 +1480,6 @@ void __cpuinit generic_processor_info(int apicid, int version)
                return;
        }
 
-       if (num_processors >= maxcpus) {
-               printk(KERN_WARNING "WARNING: maxcpus limit of %i reached."
-                       " Processor ignored.\n", maxcpus);
-               return;
-       }
-
        num_processors++;
        cpus_complement(tmp_map, cpu_present_map);
        cpu = first_cpu(tmp_map);
index 7f1f030..446c062 100644 (file)
@@ -90,7 +90,6 @@ static unsigned long apic_phys;
 
 unsigned long mp_lapic_addr;
 
-unsigned int __cpuinitdata maxcpus = NR_CPUS;
 /*
  * Get the LAPIC version
  */
@@ -1062,12 +1061,6 @@ void __cpuinit generic_processor_info(int apicid, int version)
                return;
        }
 
-       if (num_processors >= maxcpus) {
-               printk(KERN_WARNING "WARNING: maxcpus limit of %i reached."
-                      " Processor ignored.\n", maxcpus);
-               return;
-       }
-
        num_processors++;
        cpus_complement(tmp_map, cpu_present_map);
        cpu = first_cpu(tmp_map);
index de7439f..05cc22d 100644 (file)
@@ -478,7 +478,13 @@ static int setup_p4_watchdog(unsigned nmi_hz)
                perfctr_msr = MSR_P4_IQ_PERFCTR1;
                evntsel_msr = MSR_P4_CRU_ESCR0;
                cccr_msr = MSR_P4_IQ_CCCR1;
-               cccr_val = P4_CCCR_OVF_PMI1 | P4_CCCR_ESCR_SELECT(4);
+
+               /* Pentium 4 D processors don't support P4_CCCR_OVF_PMI1 */
+               if (boot_cpu_data.x86_model == 4 && boot_cpu_data.x86_mask == 4)
+                       cccr_val = P4_CCCR_OVF_PMI0;
+               else
+                       cccr_val = P4_CCCR_OVF_PMI1;
+               cccr_val |= P4_CCCR_ESCR_SELECT(4);
        }
 
        evntsel = P4_ESCR_EVENT_SELECT(0x3F)
index 2cfcbde..2d7e307 100644 (file)
@@ -222,7 +222,7 @@ static __init void map_low_mmrs(void)
 
 enum map_type {map_wb, map_uc};
 
-static void map_high(char *id, unsigned long base, int shift, enum map_type map_type)
+static __init void map_high(char *id, unsigned long base, int shift, enum map_type map_type)
 {
        unsigned long bytes, paddr;
 
index 1b318e9..9bfc4d7 100644 (file)
@@ -88,6 +88,7 @@ void __init x86_64_start_kernel(char * real_mode_data)
        BUILD_BUG_ON(!(MODULES_VADDR > __START_KERNEL));
        BUILD_BUG_ON(!(((MODULES_END - 1) & PGDIR_MASK) ==
                                (__START_KERNEL & PGDIR_MASK)));
+       BUILD_BUG_ON(__fix_to_virt(__end_of_fixed_addresses) <= MODULES_END);
 
        /* clear bss before set_intr_gate with early_idt_handler */
        clear_bss();
index ad2b15a..59fd3b6 100644 (file)
@@ -359,6 +359,7 @@ static int hpet_clocksource_register(void)
 int __init hpet_enable(void)
 {
        unsigned long id;
+       int i;
 
        if (!is_hpet_capable())
                return 0;
@@ -369,6 +370,29 @@ int __init hpet_enable(void)
         * Read the period and check for a sane value:
         */
        hpet_period = hpet_readl(HPET_PERIOD);
+
+       /*
+        * AMD SB700 based systems with spread spectrum enabled use a
+        * SMM based HPET emulation to provide proper frequency
+        * setting. The SMM code is initialized with the first HPET
+        * register access and takes some time to complete. During
+        * this time the config register reads 0xffffffff. We check
+        * for max. 1000 loops whether the config register reads a non
+        * 0xffffffff value to make sure that HPET is up and running
+        * before we go further. A counting loop is safe, as the HPET
+        * access takes thousands of CPU cycles. On non SB700 based
+        * machines this check is only done once and has no side
+        * effects.
+        */
+       for (i = 0; hpet_readl(HPET_CFG) == 0xFFFFFFFF; i++) {
+               if (i == 1000) {
+                       printk(KERN_WARNING
+                              "HPET config register value = 0xFFFFFFFF. "
+                              "Disabling HPET\n");
+                       goto out_nohpet;
+               }
+       }
+
        if (hpet_period < HPET_MIN_PERIOD || hpet_period > HPET_MAX_PERIOD)
                goto out_nohpet;
 
index 9fe478d..0732adb 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/init.h>
 #include <linux/numa.h>
 #include <linux/ftrace.h>
+#include <linux/suspend.h>
 
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
@@ -78,7 +79,7 @@ static void load_segments(void)
 /*
  * A architecture hook called to validate the
  * proposed image and prepare the control pages
- * as needed.  The pages for KEXEC_CONTROL_CODE_SIZE
+ * as needed.  The pages for KEXEC_CONTROL_PAGE_SIZE
  * have been allocated, but the segments have yet
  * been copied into the kernel.
  *
@@ -113,6 +114,7 @@ void machine_kexec(struct kimage *image)
 {
        unsigned long page_list[PAGES_NR];
        void *control_page;
+       int save_ftrace_enabled;
        asmlinkage unsigned long
                (*relocate_kernel_ptr)(unsigned long indirection_page,
                                       unsigned long control_page,
@@ -120,7 +122,12 @@ void machine_kexec(struct kimage *image)
                                       unsigned int has_pae,
                                       unsigned int preserve_context);
 
-       tracer_disable();
+#ifdef CONFIG_KEXEC_JUMP
+       if (kexec_image->preserve_context)
+               save_processor_state();
+#endif
+
+       save_ftrace_enabled = __ftrace_enabled_save();
 
        /* Interrupts aren't acceptable while we reboot */
        local_irq_disable();
@@ -138,7 +145,7 @@ void machine_kexec(struct kimage *image)
        }
 
        control_page = page_address(image->control_code_page);
-       memcpy(control_page, relocate_kernel, PAGE_SIZE/2);
+       memcpy(control_page, relocate_kernel, KEXEC_CONTROL_CODE_MAX_SIZE);
 
        relocate_kernel_ptr = control_page;
        page_list[PA_CONTROL_PAGE] = __pa(control_page);
@@ -178,6 +185,13 @@ void machine_kexec(struct kimage *image)
                                           (unsigned long)page_list,
                                           image->start, cpu_has_pae,
                                           image->preserve_context);
+
+#ifdef CONFIG_KEXEC_JUMP
+       if (kexec_image->preserve_context)
+               restore_processor_state();
+#endif
+
+       __ftrace_enabled_restore(save_ftrace_enabled);
 }
 
 void arch_crash_save_vmcoreinfo(void)
index 07c0f82..3b59951 100644 (file)
@@ -33,6 +33,8 @@
 #include <linux/module.h>
 #include <asm/geode.h>
 
+#define MFGPT_DEFAULT_IRQ      7
+
 static struct mfgpt_timer_t {
        unsigned int avail:1;
 } mfgpt_timers[MFGPT_MAX_TIMERS];
@@ -157,29 +159,48 @@ int geode_mfgpt_toggle_event(int timer, int cmp, int event, int enable)
 }
 EXPORT_SYMBOL_GPL(geode_mfgpt_toggle_event);
 
-int geode_mfgpt_set_irq(int timer, int cmp, int irq, int enable)
+int geode_mfgpt_set_irq(int timer, int cmp, int *irq, int enable)
 {
-       u32 val, dummy;
-       int offset;
+       u32 zsel, lpc, dummy;
+       int shift;
 
        if (timer < 0 || timer >= MFGPT_MAX_TIMERS)
                return -EIO;
 
-       if (geode_mfgpt_toggle_event(timer, cmp, MFGPT_EVENT_IRQ, enable))
+       /*
+        * Unfortunately, MFGPTs come in pairs sharing their IRQ lines. If VSA
+        * is using the same CMP of the timer's Siamese twin, the IRQ is set to
+        * 2, and we mustn't use nor change it.
+        * XXX: Likewise, 2 Linux drivers might clash if the 2nd overwrites the
+        * IRQ of the 1st. This can only happen if forcing an IRQ, calling this
+        * with *irq==0 is safe. Currently there _are_ no 2 drivers.
+        */
+       rdmsr(MSR_PIC_ZSEL_LOW, zsel, dummy);
+       shift = ((cmp == MFGPT_CMP1 ? 0 : 4) + timer % 4) * 4;
+       if (((zsel >> shift) & 0xF) == 2)
                return -EIO;
 
-       rdmsr(MSR_PIC_ZSEL_LOW, val, dummy);
+       /* Choose IRQ: if none supplied, keep IRQ already set or use default */
+       if (!*irq)
+               *irq = (zsel >> shift) & 0xF;
+       if (!*irq)
+               *irq = MFGPT_DEFAULT_IRQ;
 
-       offset = (timer % 4) * 4;
-
-       val &= ~((0xF << offset) | (0xF << (offset + 16)));
+       /* Can't use IRQ if it's 0 (=disabled), 2, or routed to LPC */
+       if (*irq < 1 || *irq == 2 || *irq > 15)
+               return -EIO;
+       rdmsr(MSR_PIC_IRQM_LPC, lpc, dummy);
+       if (lpc & (1 << *irq))
+               return -EIO;
 
+       /* All chosen and checked - go for it */
+       if (geode_mfgpt_toggle_event(timer, cmp, MFGPT_EVENT_IRQ, enable))
+               return -EIO;
        if (enable) {
-               val |= (irq & 0x0F) << (offset);
-               val |= (irq & 0x0F) << (offset + 16);
+               zsel = (zsel & ~(0xF << shift)) | (*irq << shift);
+               wrmsr(MSR_PIC_ZSEL_LOW, zsel, dummy);
        }
 
-       wrmsr(MSR_PIC_ZSEL_LOW, val, dummy);
        return 0;
 }
 
@@ -242,7 +263,7 @@ EXPORT_SYMBOL_GPL(geode_mfgpt_alloc_timer);
 static unsigned int mfgpt_tick_mode = CLOCK_EVT_MODE_SHUTDOWN;
 static u16 mfgpt_event_clock;
 
-static int irq = 7;
+static int irq;
 static int __init mfgpt_setup(char *str)
 {
        get_option(&str, &irq);
@@ -346,7 +367,7 @@ int __init mfgpt_timer_setup(void)
        mfgpt_event_clock = timer;
 
        /* Set up the IRQ on the MFGPT side */
-       if (geode_mfgpt_setup_irq(mfgpt_event_clock, MFGPT_CMP2, irq)) {
+       if (geode_mfgpt_setup_irq(mfgpt_event_clock, MFGPT_CMP2, &irq)) {
                printk(KERN_ERR "mfgpt-timer:  Could not set up IRQ %d\n", irq);
                return -EIO;
        }
@@ -374,13 +395,14 @@ int __init mfgpt_timer_setup(void)
                        &mfgpt_clockevent);
 
        printk(KERN_INFO
-              "mfgpt-timer:  registering the MFGPT timer as a clock event.\n");
+              "mfgpt-timer:  Registering MFGPT timer %d as a clock event, using IRQ %d\n",
+              timer, irq);
        clockevents_register_device(&mfgpt_clockevent);
 
        return 0;
 
 err:
-       geode_mfgpt_release_irq(mfgpt_event_clock, MFGPT_CMP2, irq);
+       geode_mfgpt_release_irq(mfgpt_event_clock, MFGPT_CMP2, &irq);
        printk(KERN_ERR
               "mfgpt-timer:  Unable to set up the MFGPT clock source\n");
        return -EIO;
index 9fd8095..e439380 100644 (file)
@@ -131,7 +131,7 @@ static int msr_open(struct inode *inode, struct file *file)
                ret = -EIO;     /* MSR not supported */
 out:
        unlock_kernel();
-       return 0;
+       return ret;
 }
 
 /*
index ac6d512..abb78a2 100644 (file)
@@ -114,6 +114,23 @@ static __init void nmi_cpu_busy(void *data)
 }
 #endif
 
+static void report_broken_nmi(int cpu, int *prev_nmi_count)
+{
+       printk(KERN_CONT "\n");
+
+       printk(KERN_WARNING
+               "WARNING: CPU#%d: NMI appears to be stuck (%d->%d)!\n",
+                       cpu, prev_nmi_count[cpu], get_nmi_count(cpu));
+
+       printk(KERN_WARNING
+               "Please report this to bugzilla.kernel.org,\n");
+       printk(KERN_WARNING
+               "and attach the output of the 'dmesg' command.\n");
+
+       per_cpu(wd_enabled, cpu) = 0;
+       atomic_dec(&nmi_active);
+}
+
 int __init check_nmi_watchdog(void)
 {
        unsigned int *prev_nmi_count;
@@ -141,15 +158,8 @@ int __init check_nmi_watchdog(void)
        for_each_online_cpu(cpu) {
                if (!per_cpu(wd_enabled, cpu))
                        continue;
-               if (get_nmi_count(cpu) - prev_nmi_count[cpu] <= 5) {
-                       printk(KERN_WARNING "WARNING: CPU#%d: NMI "
-                               "appears to be stuck (%d->%d)!\n",
-                               cpu,
-                               prev_nmi_count[cpu],
-                               get_nmi_count(cpu));
-                       per_cpu(wd_enabled, cpu) = 0;
-                       atomic_dec(&nmi_active);
-               }
+               if (get_nmi_count(cpu) - prev_nmi_count[cpu] <= 5)
+                       report_broken_nmi(cpu, prev_nmi_count);
        }
        endflag = 1;
        if (!atomic_read(&nmi_active)) {
index 53bc653..3b7a1dd 100644 (file)
@@ -95,7 +95,6 @@ static inline void play_dead(void)
 {
        /* This must be done before dead CPU ack */
        cpu_exit_clear();
-       wbinvd();
        mb();
        /* Ack it */
        __get_cpu_var(cpu_state) = CPU_DEAD;
@@ -104,8 +103,8 @@ static inline void play_dead(void)
         * With physical CPU hotplug, we should halt the cpu
         */
        local_irq_disable();
-       while (1)
-               halt();
+       /* mask all interrupts, flush any and all caches, and halt */
+       wbinvd_halt();
 }
 #else
 static inline void play_dead(void)
index 3fb62a7..71553b6 100644 (file)
@@ -93,14 +93,13 @@ DECLARE_PER_CPU(int, cpu_state);
 static inline void play_dead(void)
 {
        idle_task_exit();
-       wbinvd();
        mb();
        /* Ack it */
        __get_cpu_var(cpu_state) = CPU_DEAD;
 
        local_irq_disable();
-       while (1)
-               halt();
+       /* mask all interrupts, flush any and all caches, and halt */
+       wbinvd_halt();
 }
 #else
 static inline void play_dead(void)
index 703310a..6f50664 100644 (file)
 #define PAGE_ATTR (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
 #define PAE_PGD_ATTR (_PAGE_PRESENT)
 
-/* control_page + PAGE_SIZE/2 ~ control_page + PAGE_SIZE * 3/4 are
- * used to save some data for jumping back
+/* control_page + KEXEC_CONTROL_CODE_MAX_SIZE
+ * ~ control_page + PAGE_SIZE are used as data storage and stack for
+ * jumping back
  */
-#define DATA(offset)           (PAGE_SIZE/2+(offset))
+#define DATA(offset)           (KEXEC_CONTROL_CODE_MAX_SIZE+(offset))
 
 /* Minimal CPU state */
 #define ESP                    DATA(0x0)
@@ -376,3 +377,6 @@ swap_pages:
        popl    %ebx
        popl    %ebp
        ret
+
+       .globl kexec_control_code_size
+.set kexec_control_code_size, . - relocate_kernel
index 68b48e3..a4656ad 100644 (file)
@@ -445,7 +445,7 @@ static void __init reserve_early_setup_data(void)
  * @size: Size of the crashkernel memory to reserve.
  * Returns the base address on success, and -1ULL on failure.
  */
-unsigned long long find_and_reserve_crashkernel(unsigned long long size)
+unsigned long long __init find_and_reserve_crashkernel(unsigned long long size)
 {
        const unsigned long long alignment = 16<<20;    /* 16M */
        unsigned long long start = 0LL;
index b45ef8d..ca316b5 100644 (file)
@@ -104,7 +104,16 @@ static inline int restore_i387(struct _fpstate __user *buf)
                clts();
                task_thread_info(current)->status |= TS_USEDFPU;
        }
-       return restore_fpu_checking((__force struct i387_fxsave_struct *)buf);
+       err = restore_fpu_checking((__force struct i387_fxsave_struct *)buf);
+       if (unlikely(err)) {
+               /*
+                * Encountered an error while doing the restore from the
+                * user buffer, clear the fpu state.
+                */
+               clear_fpu(tsk);
+               clear_used_math();
+       }
+       return err;
 }
 
 /*
index 91055d7..a8fb8a9 100644 (file)
@@ -994,17 +994,7 @@ int __cpuinit native_cpu_up(unsigned int cpu)
        flush_tlb_all();
        low_mappings = 1;
 
-#ifdef CONFIG_X86_PC
-       if (def_to_bigsmp && apicid > 8) {
-               printk(KERN_WARNING
-                       "More than 8 CPUs detected - skipping them.\n"
-                       "Use CONFIG_X86_GENERICARCH and CONFIG_X86_BIGSMP.\n");
-               err = -1;
-       } else
-               err = do_boot_cpu(apicid, cpu);
-#else
        err = do_boot_cpu(apicid, cpu);
-#endif
 
        zap_low_mappings();
        low_mappings = 0;
@@ -1058,6 +1048,34 @@ static __init void disable_smp(void)
 static int __init smp_sanity_check(unsigned max_cpus)
 {
        preempt_disable();
+
+#if defined(CONFIG_X86_PC) && defined(CONFIG_X86_32)
+       if (def_to_bigsmp && nr_cpu_ids > 8) {
+               unsigned int cpu;
+               unsigned nr;
+
+               printk(KERN_WARNING
+                      "More than 8 CPUs detected - skipping them.\n"
+                      "Use CONFIG_X86_GENERICARCH and CONFIG_X86_BIGSMP.\n");
+
+               nr = 0;
+               for_each_present_cpu(cpu) {
+                       if (nr >= 8)
+                               cpu_clear(cpu, cpu_present_map);
+                       nr++;
+               }
+
+               nr = 0;
+               for_each_possible_cpu(cpu) {
+                       if (nr >= 8)
+                               cpu_clear(cpu, cpu_possible_map);
+                       nr++;
+               }
+
+               nr_cpu_ids = 8;
+       }
+#endif
+
        if (!physid_isset(hard_smp_processor_id(), phys_cpu_present_map)) {
                printk(KERN_WARNING "weird, boot CPU (#%d) not listed"
                                    "by the BIOS.\n", hard_smp_processor_id());
@@ -1386,17 +1404,3 @@ void __cpu_die(unsigned int cpu)
        BUG();
 }
 #endif
-
-/*
- * If the BIOS enumerates physical processors before logical,
- * maxcpus=N at enumeration-time can be used to disable HT.
- */
-static int __init parse_maxcpus(char *arg)
-{
-       extern unsigned int maxcpus;
-
-       if (arg)
-               maxcpus = simple_strtoul(arg, NULL, 0);
-       return 0;
-}
-early_param("maxcpus", parse_maxcpus);
index 99941b3..397e309 100644 (file)
@@ -8,18 +8,21 @@
 DEFINE_PER_CPU(unsigned long, this_cpu_off);
 EXPORT_PER_CPU_SYMBOL(this_cpu_off);
 
-/* Initialize the CPU's GDT.  This is either the boot CPU doing itself
-   (still using the master per-cpu area), or a CPU doing it for a
-   secondary which will soon come up. */
+/*
+ * Initialize the CPU's GDT.  This is either the boot CPU doing itself
+ * (still using the master per-cpu area), or a CPU doing it for a
+ * secondary which will soon come up.
+ */
 __cpuinit void init_gdt(int cpu)
 {
-       struct desc_struct *gdt = get_cpu_gdt_table(cpu);
+       struct desc_struct gdt;
 
-       pack_descriptor(&gdt[GDT_ENTRY_PERCPU],
-                       __per_cpu_offset[cpu], 0xFFFFF,
+       pack_descriptor(&gdt, __per_cpu_offset[cpu], 0xFFFFF,
                        0x2 | DESCTYPE_S, 0x8);
+       gdt.s = 1;
 
-       gdt[GDT_ENTRY_PERCPU].s = 1;
+       write_gdt_entry(get_cpu_gdt_table(cpu),
+                       GDT_ENTRY_PERCPU, &gdt, DESCTYPE_S);
 
        per_cpu(this_cpu_off, cpu) = __per_cpu_offset[cpu];
        per_cpu(cpu_number, cpu) = cpu;
index 3f18d73..513caac 100644 (file)
@@ -1131,7 +1131,14 @@ asmlinkage void math_state_restore(void)
        }
 
        clts();                         /* Allow maths ops (or we recurse) */
-       restore_fpu_checking(&me->thread.xstate->fxsave);
+       /*
+        * Paranoid restore. send a SIGSEGV if we fail to restore the state.
+        */
+       if (unlikely(restore_fpu_checking(&me->thread.xstate->fxsave))) {
+               stts();
+               force_sig(SIGSEGV, me);
+               return;
+       }
        task_thread_info(me)->status |= TS_USEDFPU;
        me->fpu_counter++;
 }
index 41e01b1..594ef47 100644 (file)
@@ -184,8 +184,6 @@ static int __init visws_get_smp_config(unsigned int early)
        return 1;
 }
 
-extern unsigned int __cpuinitdata maxcpus;
-
 /*
  * The Visual Workstation is Intel MP compliant in the hardware
  * sense, but it doesn't have a BIOS(-configuration table).
@@ -244,8 +242,8 @@ static int __init visws_find_smp_config(unsigned int reserve)
                ncpus = CO_CPU_MAX;
        }
 
-       if (ncpus > maxcpus)
-               ncpus = maxcpus;
+       if (ncpus > setup_max_cpus)
+               ncpus = setup_max_cpus;
 
 #ifdef CONFIG_X86_LOCAL_APIC
        smp_found_config = 1;
index cdb2363..af5bdad 100644 (file)
@@ -209,3 +209,11 @@ SECTIONS
 
   DWARF_DEBUG
 }
+
+#ifdef CONFIG_KEXEC
+/* Link time checks */
+#include <asm/kexec.h>
+
+ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE,
+       "kexec control code size is too big")
+#endif
index 129618c..a87ea0e 100644 (file)
@@ -60,7 +60,7 @@ static unsigned long dma_reserve __initdata;
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 
-int direct_gbpages __meminitdata
+int direct_gbpages
 #ifdef CONFIG_DIRECT_GBPAGES
                                = 1
 #endif
@@ -88,7 +88,11 @@ early_param("gbpages", parse_direct_gbpages_on);
 
 int after_bootmem;
 
-static __init void *spp_getpage(void)
+/*
+ * NOTE: This function is marked __ref because it calls __init function
+ * (alloc_bootmem_pages). It's safe to do it ONLY when after_bootmem == 0.
+ */
+static __ref void *spp_getpage(void)
 {
        void *ptr;
 
@@ -314,6 +318,7 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end,
 {
        unsigned long pages = 0;
        unsigned long last_map_addr = end;
+       unsigned long start = address;
 
        int i = pmd_index(address);
 
@@ -334,6 +339,9 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end,
                        if (!pmd_large(*pmd))
                                last_map_addr = phys_pte_update(pmd, address,
                                                                 end);
+                       /* Count entries we're using from level2_ident_pgt */
+                       if (start == 0)
+                               pages++;
                        continue;
                }
 
index 016f335..6ba6f88 100644 (file)
@@ -170,7 +170,7 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr,
        phys_addr &= PAGE_MASK;
        size = PAGE_ALIGN(last_addr+1) - phys_addr;
 
-       retval = reserve_memtype(phys_addr, phys_addr + size,
+       retval = reserve_memtype(phys_addr, (u64)phys_addr + size,
                                                prot_val, &new_prot_val);
        if (retval) {
                pr_debug("Warning: reserve_memtype returned %d\n", retval);
index 0dcd42e..d4aa503 100644 (file)
@@ -221,8 +221,7 @@ static int pageattr_test(void)
        failed += print_split(&sc);
 
        if (failed) {
-               printk(KERN_ERR "NOT PASSED. Please report.\n");
-               WARN_ON(1);
+               WARN(1, KERN_ERR "NOT PASSED. Please report.\n");
                return -EINVAL;
        } else {
                if (print)
index 65c6e46..f5f5154 100644 (file)
@@ -55,13 +55,19 @@ static void split_page_count(int level)
 
 int arch_report_meminfo(char *page)
 {
-       int n = sprintf(page, "DirectMap4k:  %8lu\n"
-                       "DirectMap2M:  %8lu\n",
-                       direct_pages_count[PG_LEVEL_4K],
-                       direct_pages_count[PG_LEVEL_2M]);
+       int n = sprintf(page, "DirectMap4k:  %8lu kB\n",
+                       direct_pages_count[PG_LEVEL_4K] << 2);
+#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
+       n += sprintf(page + n, "DirectMap2M:  %8lu kB\n",
+                       direct_pages_count[PG_LEVEL_2M] << 11);
+#else
+       n += sprintf(page + n, "DirectMap4M:  %8lu kB\n",
+                       direct_pages_count[PG_LEVEL_2M] << 12);
+#endif
 #ifdef CONFIG_X86_64
-       n += sprintf(page + n, "DirectMap1G:  %8lu\n",
-                    direct_pages_count[PG_LEVEL_1G]);
+       if (direct_gbpages)
+               n += sprintf(page + n, "DirectMap1G:  %8lu kB\n",
+                       direct_pages_count[PG_LEVEL_1G] << 20);
 #endif
        return n;
 }
@@ -592,10 +598,9 @@ repeat:
        if (!pte_val(old_pte)) {
                if (!primary)
                        return 0;
-               printk(KERN_WARNING "CPA: called for zero pte. "
+               WARN(1, KERN_WARNING "CPA: called for zero pte. "
                       "vaddr = %lx cpa->vaddr = %lx\n", address,
                       cpa->vaddr);
-               WARN_ON(1);
                return -EINVAL;
        }
 
index 1eb2973..16ae70f 100644 (file)
@@ -178,7 +178,7 @@ void acpi_numa_arch_fixup(void)
  * start of the node, and that the current "end" address is after
  * the previous one.
  */
-static __init void node_read_chunk(int nid, struct node_memory_chunk_s *memory_chunk)
+static __init int node_read_chunk(int nid, struct node_memory_chunk_s *memory_chunk)
 {
        /*
         * Only add present memory as told by the e820.
@@ -189,10 +189,10 @@ static __init void node_read_chunk(int nid, struct node_memory_chunk_s *memory_c
        if (memory_chunk->start_pfn >= max_pfn) {
                printk(KERN_INFO "Ignoring SRAT pfns: %08lx - %08lx\n",
                        memory_chunk->start_pfn, memory_chunk->end_pfn);
-               return;
+               return -1;
        }
        if (memory_chunk->nid != nid)
-               return;
+               return -1;
 
        if (!node_has_online_mem(nid))
                node_start_pfn[nid] = memory_chunk->start_pfn;
@@ -202,6 +202,8 @@ static __init void node_read_chunk(int nid, struct node_memory_chunk_s *memory_c
 
        if (node_end_pfn[nid] < memory_chunk->end_pfn)
                node_end_pfn[nid] = memory_chunk->end_pfn;
+
+       return 0;
 }
 
 int __init get_memcfg_from_srat(void)
@@ -259,7 +261,9 @@ int __init get_memcfg_from_srat(void)
                printk(KERN_DEBUG
                        "chunk %d nid %d start_pfn %08lx end_pfn %08lx\n",
                       j, chunk->nid, chunk->start_pfn, chunk->end_pfn);
-               node_read_chunk(chunk->nid, chunk);
+               if (node_read_chunk(chunk->nid, chunk))
+                       continue;
+
                e820_register_active_regions(chunk->nid, chunk->start_pfn,
                                             min(chunk->end_pfn, max_pfn));
        }
index 23faaa8..2bd5c53 100644 (file)
@@ -365,7 +365,7 @@ static void __init pci_mmcfg_reject_broken(int early)
        return;
 
 reject:
-       printk(KERN_ERR "PCI: Not using MMCONFIG.\n");
+       printk(KERN_INFO "PCI: Not using MMCONFIG.\n");
        pci_mmcfg_arch_free();
        kfree(pci_mmcfg_config);
        pci_mmcfg_config = NULL;
index bb7c51f..7d2edf1 100644 (file)
@@ -563,9 +563,6 @@ EXPORT_SYMBOL_GPL(unregister_hotplug_dock_device);
  */
 static int handle_eject_request(struct dock_station *ds, u32 event)
 {
-       if (!dock_present(ds))
-               return -ENODEV;
-
        if (dock_in_progress(ds))
                return -EBUSY;
 
@@ -573,8 +570,16 @@ static int handle_eject_request(struct dock_station *ds, u32 event)
         * here we need to generate the undock
         * event prior to actually doing the undock
         * so that the device struct still exists.
+        * Also, even send the dock event if the
+        * device is not present anymore
         */
        dock_event(ds, event, UNDOCK_EVENT);
+
+       if (!dock_present(ds)) {
+               complete_undock(ds);
+               return -ENODEV;
+       }
+
        hotplug_dock_devices(ds, ACPI_NOTIFY_EJECT_REQUEST);
        undock(ds);
        eject_dock(ds);
index 5622aee..13593f9 100644 (file)
@@ -110,6 +110,31 @@ static struct acpi_ec {
        u8 handlers_installed;
 } *boot_ec, *first_ec;
 
+/* 
+ * Some Asus system have exchanged ECDT data/command IO addresses.
+ */
+static int print_ecdt_error(const struct dmi_system_id *id)
+{
+       printk(KERN_NOTICE PREFIX "%s detected - "
+               "ECDT has exchanged control/data I/O address\n",
+               id->ident);
+       return 0;
+}
+
+static struct dmi_system_id __cpuinitdata ec_dmi_table[] = {
+       {
+       print_ecdt_error, "Asus L4R", {
+       DMI_MATCH(DMI_BIOS_VERSION, "1008.006"),
+       DMI_MATCH(DMI_PRODUCT_NAME, "L4R"),
+       DMI_MATCH(DMI_BOARD_NAME, "L4R") }, NULL},
+       {
+       print_ecdt_error, "Asus M6R", {
+       DMI_MATCH(DMI_BIOS_VERSION, "0207"),
+       DMI_MATCH(DMI_PRODUCT_NAME, "M6R"),
+       DMI_MATCH(DMI_BOARD_NAME, "M6R") }, NULL},
+       {},
+};
+
 /* --------------------------------------------------------------------------
                              Transaction Management
    -------------------------------------------------------------------------- */
@@ -196,6 +221,8 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
                                return 0;
                        msleep(1);
                }
+               if (acpi_ec_check_status(ec,event))
+                       return 0;
        }
        pr_err(PREFIX "acpi_ec_wait timeout, status = 0x%2.2x, event = %s\n",
                acpi_ec_read_status(ec),
@@ -911,6 +938,15 @@ int __init acpi_ec_ecdt_probe(void)
                pr_info(PREFIX "EC description table is found, configuring boot EC\n");
                boot_ec->command_addr = ecdt_ptr->control.address;
                boot_ec->data_addr = ecdt_ptr->data.address;
+               if (dmi_check_system(ec_dmi_table)) {
+                       /*
+                        * If the board falls into ec_dmi_table, it means
+                        * that ECDT table gives the incorrect command/status
+                        * & data I/O address. Just fix it.
+                        */
+                       boot_ec->data_addr = ecdt_ptr->control.address;
+                       boot_ec->command_addr = ecdt_ptr->data.address;
+               }
                boot_ec->gpe = ecdt_ptr->gpe;
                boot_ec->handle = ACPI_ROOT_OBJECT;
                acpi_get_handle(ACPI_ROOT_OBJECT, ecdt_ptr->id, &boot_ec->handle);
index 89f3b2a..cf47805 100644 (file)
@@ -849,7 +849,7 @@ static int __init acpi_irq_penalty_update(char *str, int used)
                if (irq < 0)
                        continue;
 
-               if (irq >= ACPI_MAX_IRQS)
+               if (irq >= ARRAY_SIZE(acpi_irq_penalty))
                        continue;
 
                if (used)
@@ -872,10 +872,12 @@ static int __init acpi_irq_penalty_update(char *str, int used)
  */
 void acpi_penalize_isa_irq(int irq, int active)
 {
-       if (active)
-               acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED;
-       else
-               acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING;
+       if (irq >= 0 && irq < ARRAY_SIZE(acpi_irq_penalty)) {
+               if (active)
+                       acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED;
+               else
+                       acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING;
+       }
 }
 
 /*
index e36422a..ee68ac5 100644 (file)
@@ -123,7 +123,7 @@ struct acpi_processor_errata errata __read_mostly;
 static int set_no_mwait(const struct dmi_system_id *id)
 {
        printk(KERN_NOTICE PREFIX "%s detected - "
-               "disable mwait for CPU C-stetes\n", id->ident);
+               "disabling mwait for CPU C-states\n", id->ident);
        idle_nomwait = 1;
        return 0;
 }
@@ -138,7 +138,7 @@ static struct dmi_system_id __cpuinitdata processor_idle_dmi_table[] = {
        {
        set_no_mwait, "Extensa 5220", {
        DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-       DMI_MATCH(DMI_SYS_VENDOR, "ACER"),
+       DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
        DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
        DMI_MATCH(DMI_BOARD_NAME, "Columbia") }, NULL},
        {},
index 283c08f..cf5b1b7 100644 (file)
@@ -41,7 +41,6 @@
 #include <linux/pm_qos_params.h>
 #include <linux/clockchips.h>
 #include <linux/cpuidle.h>
-#include <linux/cpuidle.h>
 
 /*
  * Include the apic definitions for x86 to have the APIC timer related defines
index 0133af4..80c251e 100644 (file)
@@ -70,8 +70,8 @@ static DEFINE_MUTEX(performance_mutex);
  *  0 -> cpufreq low level drivers initialized -> consider _PPC values
  *  1 -> ignore _PPC totally -> forced by user through boot param
  */
-static unsigned int ignore_ppc = -1;
-module_param(ignore_ppc, uint, 0644);
+static int ignore_ppc = -1;
+module_param(ignore_ppc, int, 0644);
 MODULE_PARM_DESC(ignore_ppc, "If the frequency of your machine gets wrongly" \
                 "limited by BIOS, this should help");
 
index c33b1c6..cfe2c83 100644 (file)
@@ -347,7 +347,7 @@ struct acpi_buffer *out)
        strcpy(method, "WQ");
        strncat(method, block->object_id, 2);
 
-       status = acpi_evaluate_object(handle, method, NULL, out);
+       status = acpi_evaluate_object(handle, method, &input, out);
 
        /*
         * If ACPI_WMI_EXPENSIVE, call the relevant WCxx method, even if
index b141450..3a23e76 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
 #include <linux/uaccess.h>
-#include <linux/version.h>
 
 #include "tty.h"
 #include "network.h"
index 509c89a..08911ed 100644 (file)
@@ -47,7 +47,6 @@
 
 
 #include <linux/module.h>
-#include <linux/version.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
index 0e6866f..a27160b 100644 (file)
@@ -2496,45 +2496,25 @@ static int tiocgwinsz(struct tty_struct *tty, struct winsize __user *arg)
 }
 
 /**
- *     tiocswinsz              -       implement window size set ioctl
- *     @tty; tty
- *     @arg: user buffer for result
+ *     tty_do_resize           -       resize event
+ *     @tty: tty being resized
+ *     @real_tty: real tty (if using a pty/tty pair)
+ *     @rows: rows (character)
+ *     @cols: cols (character)
  *
- *     Copies the user idea of the window size to the kernel. Traditionally
- *     this is just advisory information but for the Linux console it
- *     actually has driver level meaning and triggers a VC resize.
- *
- *     Locking:
- *             Called function use the console_sem is used to ensure we do
- *     not try and resize the console twice at once.
- *             The tty->termios_mutex is used to ensure we don't double
- *     resize and get confused. Lock order - tty->termios_mutex before
- *     console sem
+ *     Update the termios variables and send the neccessary signals to
+ *     peform a terminal resize correctly
  */
 
-static int tiocswinsz(struct tty_struct *tty, struct tty_struct *real_tty,
-       struct winsize __user *arg)
+int tty_do_resize(struct tty_struct *tty, struct tty_struct *real_tty,
+                                       struct winsize *ws)
 {
-       struct winsize tmp_ws;
        struct pid *pgrp, *rpgrp;
        unsigned long flags;
 
-       if (copy_from_user(&tmp_ws, arg, sizeof(*arg)))
-               return -EFAULT;
-
        mutex_lock(&tty->termios_mutex);
-       if (!memcmp(&tmp_ws, &tty->winsize, sizeof(*arg)))
+       if (!memcmp(ws, &tty->winsize, sizeof(*ws)))
                goto done;
-
-#ifdef CONFIG_VT
-       if (tty->driver->type == TTY_DRIVER_TYPE_CONSOLE) {
-               if (vc_lock_resize(tty->driver_data, tmp_ws.ws_col,
-                                       tmp_ws.ws_row)) {
-                       mutex_unlock(&tty->termios_mutex);
-                       return -ENXIO;
-               }
-       }
-#endif
        /* Get the PID values and reference them so we can
           avoid holding the tty ctrl lock while sending signals */
        spin_lock_irqsave(&tty->ctrl_lock, flags);
@@ -2550,13 +2530,41 @@ static int tiocswinsz(struct tty_struct *tty, struct tty_struct *real_tty,
        put_pid(pgrp);
        put_pid(rpgrp);
 
-       tty->winsize = tmp_ws;
-       real_tty->winsize = tmp_ws;
+       tty->winsize = *ws;
+       real_tty->winsize = *ws;
 done:
        mutex_unlock(&tty->termios_mutex);
        return 0;
 }
 
+/**
+ *     tiocswinsz              -       implement window size set ioctl
+ *     @tty; tty
+ *     @arg: user buffer for result
+ *
+ *     Copies the user idea of the window size to the kernel. Traditionally
+ *     this is just advisory information but for the Linux console it
+ *     actually has driver level meaning and triggers a VC resize.
+ *
+ *     Locking:
+ *             Driver dependant. The default do_resize method takes the
+ *     tty termios mutex and ctrl_lock. The console takes its own lock
+ *     then calls into the default method.
+ */
+
+static int tiocswinsz(struct tty_struct *tty, struct tty_struct *real_tty,
+       struct winsize __user *arg)
+{
+       struct winsize tmp_ws;
+       if (copy_from_user(&tmp_ws, arg, sizeof(*arg)))
+               return -EFAULT;
+
+       if (tty->ops->resize)
+               return tty->ops->resize(tty, real_tty, &tmp_ws);
+       else
+               return tty_do_resize(tty, real_tty, &tmp_ws);
+}
+
 /**
  *     tioccons        -       allow admin to move logical console
  *     @file: the file to become console
index 1bc00c9..60359c3 100644 (file)
@@ -803,7 +803,25 @@ static inline int resize_screen(struct vc_data *vc, int width, int height,
  */
 #define VC_RESIZE_MAXCOL (32767)
 #define VC_RESIZE_MAXROW (32767)
-int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
+
+/**
+ *     vc_do_resize    -       resizing method for the tty
+ *     @tty: tty being resized
+ *     @real_tty: real tty (different to tty if a pty/tty pair)
+ *     @vc: virtual console private data
+ *     @cols: columns
+ *     @lines: lines
+ *
+ *     Resize a virtual console, clipping according to the actual constraints.
+ *     If the caller passes a tty structure then update the termios winsize
+ *     information and perform any neccessary signal handling.
+ *
+ *     Caller must hold the console semaphore. Takes the termios mutex and
+ *     ctrl_lock of the tty IFF a tty is passed.
+ */
+
+static int vc_do_resize(struct tty_struct *tty, struct tty_struct *real_tty,
+               struct vc_data *vc, unsigned int cols, unsigned int lines)
 {
        unsigned long old_origin, new_origin, new_scr_end, rlth, rrem, err = 0;
        unsigned int old_cols, old_rows, old_row_size, old_screen_size;
@@ -907,24 +925,15 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
        gotoxy(vc, vc->vc_x, vc->vc_y);
        save_cur(vc);
 
-       if (vc->vc_tty) {
-               struct winsize ws, *cws = &vc->vc_tty->winsize;
-               struct pid *pgrp = NULL;
-
+       if (tty) {
+               /* Rewrite the requested winsize data with the actual
+                  resulting sizes */
+               struct winsize ws;
                memset(&ws, 0, sizeof(ws));
                ws.ws_row = vc->vc_rows;
                ws.ws_col = vc->vc_cols;
                ws.ws_ypixel = vc->vc_scan_lines;
-
-               spin_lock_irq(&vc->vc_tty->ctrl_lock);
-               if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col))
-                       pgrp = get_pid(vc->vc_tty->pgrp);
-               spin_unlock_irq(&vc->vc_tty->ctrl_lock);
-               if (pgrp) {
-                       kill_pgrp(vc->vc_tty->pgrp, SIGWINCH, 1);
-                       put_pid(pgrp);
-               }
-               *cws = ws;
+               tty_do_resize(tty, real_tty, &ws);
        }
 
        if (CON_IS_VISIBLE(vc))
@@ -932,14 +941,47 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
        return err;
 }
 
-int vc_lock_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
+/**
+ *     vc_resize               -       resize a VT
+ *     @vc: virtual console
+ *     @cols: columns
+ *     @rows: rows
+ *
+ *     Resize a virtual console as seen from the console end of things. We
+ *     use the common vc_do_resize methods to update the structures. The
+ *     caller must hold the console sem to protect console internals and
+ *     vc->vc_tty
+ */
+
+int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int rows)
+{
+       return vc_do_resize(vc->vc_tty, vc->vc_tty, vc, cols, rows);
+}
+
+/**
+ *     vt_resize               -       resize a VT
+ *     @tty: tty to resize
+ *     @real_tty: tty if a pty/tty pair
+ *     @ws: winsize attributes
+ *
+ *     Resize a virtual terminal. This is called by the tty layer as we
+ *     register our own handler for resizing. The mutual helper does all
+ *     the actual work.
+ *
+ *     Takes the console sem and the called methods then take the tty
+ *     termios_mutex and the tty ctrl_lock in that order.
+ */
+
+int vt_resize(struct tty_struct *tty, struct tty_struct *real_tty,
+       struct winsize *ws)
 {
-       int rc;
+       struct vc_data *vc = tty->driver_data;
+       int ret;
 
        acquire_console_sem();
-       rc = vc_resize(vc, cols, lines);
+       ret = vc_do_resize(tty, real_tty, vc, ws->ws_col, ws->ws_row);
        release_console_sem();
-       return rc;
+       return ret;
 }
 
 void vc_deallocate(unsigned int currcons)
@@ -2907,6 +2949,7 @@ static const struct tty_operations con_ops = {
        .start = con_start,
        .throttle = con_throttle,
        .unthrottle = con_unthrottle,
+       .resize = vt_resize,
 };
 
 int __init vty_init(void)
@@ -4061,7 +4104,6 @@ EXPORT_SYMBOL(default_blu);
 EXPORT_SYMBOL(update_region);
 EXPORT_SYMBOL(redraw_screen);
 EXPORT_SYMBOL(vc_resize);
-EXPORT_SYMBOL(vc_lock_resize);
 EXPORT_SYMBOL(fg_console);
 EXPORT_SYMBOL(console_blank_hook);
 EXPORT_SYMBOL(console_blanked);
index 3211afd..c904e9a 100644 (file)
@@ -947,14 +947,16 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
                    get_user(cc, &vtsizes->v_cols))
                        ret = -EFAULT;
                else {
+                       acquire_console_sem();
                        for (i = 0; i < MAX_NR_CONSOLES; i++) {
                                vc = vc_cons[i].d;
 
                                if (vc) {
                                        vc->vc_resize_user = 1;
-                                       vc_lock_resize(vc_cons[i].d, cc, ll);
+                                       vc_resize(vc_cons[i].d, cc, ll);
                                }
                        }
+                       release_console_sem();
                }
                break;
        }
index 8bfee5f..278c985 100644 (file)
@@ -74,7 +74,6 @@
  * currently programmed in the FPGA.
  */
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
index ba7b9a6..a4bec3f 100644 (file)
@@ -67,10 +67,17 @@ static int ladder_select_state(struct cpuidle_device *dev)
        struct ladder_device *ldev = &__get_cpu_var(ladder_devices);
        struct ladder_device_state *last_state;
        int last_residency, last_idx = ldev->last_state_idx;
+       int latency_req = pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY);
 
        if (unlikely(!ldev))
                return 0;
 
+       /* Special case when user has set very strict latency requirement */
+       if (unlikely(latency_req == 0)) {
+               ladder_do_selection(ldev, last_idx, 0);
+               return 0;
+       }
+
        last_state = &ldev->states[last_idx];
 
        if (dev->states[last_idx].flags & CPUIDLE_FLAG_TIME_VALID)
@@ -81,8 +88,7 @@ static int ladder_select_state(struct cpuidle_device *dev)
        /* consider promotion */
        if (last_idx < dev->state_count - 1 &&
            last_residency > last_state->threshold.promotion_time &&
-           dev->states[last_idx + 1].exit_latency <=
-                       pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY)) {
+           dev->states[last_idx + 1].exit_latency <= latency_req) {
                last_state->stats.promotion_count++;
                last_state->stats.demotion_count = 0;
                if (last_state->stats.promotion_count >= last_state->threshold.promotion_count) {
@@ -92,7 +98,19 @@ static int ladder_select_state(struct cpuidle_device *dev)
        }
 
        /* consider demotion */
-       if (last_idx > 0 &&
+       if (last_idx > CPUIDLE_DRIVER_STATE_START &&
+           dev->states[last_idx].exit_latency > latency_req) {
+               int i;
+
+               for (i = last_idx - 1; i > CPUIDLE_DRIVER_STATE_START; i--) {
+                       if (dev->states[i].exit_latency <= latency_req)
+                               break;
+               }
+               ladder_do_selection(ldev, last_idx, i);
+               return i;
+       }
+
+       if (last_idx > CPUIDLE_DRIVER_STATE_START &&
            last_residency < last_state->threshold.demotion_time) {
                last_state->stats.demotion_count++;
                last_state->stats.promotion_count = 0;
@@ -117,7 +135,7 @@ static int ladder_enable_device(struct cpuidle_device *dev)
        struct ladder_device_state *lstate;
        struct cpuidle_state *state;
 
-       ldev->last_state_idx = 0;
+       ldev->last_state_idx = CPUIDLE_DRIVER_STATE_START;
 
        for (i = 0; i < dev->state_count; i++) {
                state = &dev->states[i];
index 78d77c5..8d7cf3f 100644 (file)
@@ -34,21 +34,28 @@ static DEFINE_PER_CPU(struct menu_device, menu_devices);
 static int menu_select(struct cpuidle_device *dev)
 {
        struct menu_device *data = &__get_cpu_var(menu_devices);
+       int latency_req = pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY);
        int i;
 
+       /* Special case when user has set very strict latency requirement */
+       if (unlikely(latency_req == 0)) {
+               data->last_state_idx = 0;
+               return 0;
+       }
+
        /* determine the expected residency time */
        data->expected_us =
                (u32) ktime_to_ns(tick_nohz_get_sleep_length()) / 1000;
 
        /* find the deepest idle state that satisfies our constraints */
-       for (i = 1; i < dev->state_count; i++) {
+       for (i = CPUIDLE_DRIVER_STATE_START + 1; i < dev->state_count; i++) {
                struct cpuidle_state *s = &dev->states[i];
 
                if (s->target_residency > data->expected_us)
                        break;
                if (s->target_residency > data->predicted_us)
                        break;
-               if (s->exit_latency > pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY))
+               if (s->exit_latency > latency_req)
                        break;
        }
 
@@ -67,9 +74,9 @@ static void menu_reflect(struct cpuidle_device *dev)
 {
        struct menu_device *data = &__get_cpu_var(menu_devices);
        int last_idx = data->last_state_idx;
-       unsigned int measured_us =
-               cpuidle_get_last_residency(dev) + data->elapsed_us;
+       unsigned int last_idle_us = cpuidle_get_last_residency(dev);
        struct cpuidle_state *target = &dev->states[last_idx];
+       unsigned int measured_us;
 
        /*
         * Ugh, this idle state doesn't support residency measurements, so we
@@ -77,20 +84,27 @@ static void menu_reflect(struct cpuidle_device *dev)
         * for one full standard timer tick.  However, be aware that this
         * could potentially result in a suboptimal state transition.
         */
-       if (!(target->flags & CPUIDLE_FLAG_TIME_VALID))
-               measured_us = USEC_PER_SEC / HZ;
+       if (unlikely(!(target->flags & CPUIDLE_FLAG_TIME_VALID)))
+               last_idle_us = USEC_PER_SEC / HZ;
+
+       /*
+        * measured_us and elapsed_us are the cumulative idle time, since the
+        * last time we were woken out of idle by an interrupt.
+        */
+       if (data->elapsed_us <= data->elapsed_us + last_idle_us)
+               measured_us = data->elapsed_us + last_idle_us;
+       else
+               measured_us = -1;
+
+       /* Predict time until next break event */
+       data->predicted_us = max(measured_us, data->last_measured_us);
 
-       /* Predict time remaining until next break event */
-       if (measured_us + BREAK_FUZZ < data->expected_us - target->exit_latency) {
-               data->predicted_us = max(measured_us, data->last_measured_us);
+       if (last_idle_us + BREAK_FUZZ <
+           data->expected_us - target->exit_latency) {
                data->last_measured_us = measured_us;
                data->elapsed_us = 0;
        } else {
-               if (data->elapsed_us < data->elapsed_us + measured_us)
-                       data->elapsed_us = measured_us;
-               else
-                       data->elapsed_us = -1;
-               data->predicted_us = max(measured_us, data->last_measured_us);
+               data->elapsed_us = measured_us;
        }
 }
 
index a4e4494..0328da0 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
 #include <linux/memory.h>
-#include <asm/plat-orion/mv_xor.h>
+#include <plat/mv_xor.h>
 #include "mv_xor.h"
 
 static void mv_xor_issue_pending(struct dma_chan *chan);
index 61e78a4..b15f882 100644 (file)
@@ -654,12 +654,12 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI, HID_QUIRK_APPLE_HAS_FN },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_JIS, HID_QUIRK_APPLE_HAS_FN },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI, HID_QUIRK_APPLE_HAS_FN },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
-       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS, HID_QUIRK_APPLE_HAS_FN },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD | HID_QUIRK_IGNORE_MOUSE},
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_JIS, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE},
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE},
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD | HID_QUIRK_IGNORE_MOUSE },
+       { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS, HID_QUIRK_APPLE_HAS_FN  | HID_QUIRK_IGNORE_MOUSE },
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
        { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
 
index bf4ebfb..d402e8d 100644 (file)
@@ -77,6 +77,22 @@ config SENSORS_AD7418
          This driver can also be built as a module. If so, the module
          will be called ad7418.
 
+config SENSORS_ADCXX
+       tristate "National Semiconductor ADCxxxSxxx"
+       depends on SPI_MASTER && EXPERIMENTAL
+       help
+         If you say yes here you get support for the National Semiconductor
+         ADC<bb><c>S<sss> chip family, where
+         * bb  is the resolution in number of bits (8, 10, 12)
+         * c   is the number of channels (1, 2, 4, 8)
+         * sss is the maximum conversion speed (021 for 200 kSPS, 051 for 500
+           kSPS and 101 for 1 MSPS)
+
+         Examples : ADC081S101, ADC124S501, ...
+
+         This driver can also be built as a module.  If so, the module
+         will be called adcxx.
+
 config SENSORS_ADM1021
        tristate "Analog Devices ADM1021 and compatibles"
        depends on I2C
index 7943e5c..950134a 100644 (file)
@@ -17,6 +17,7 @@ obj-$(CONFIG_SENSORS_ABITUGURU)       += abituguru.o
 obj-$(CONFIG_SENSORS_ABITUGURU3)+= abituguru3.o
 obj-$(CONFIG_SENSORS_AD7414)   += ad7414.o
 obj-$(CONFIG_SENSORS_AD7418)   += ad7418.o
+obj-$(CONFIG_SENSORS_ADCXX)    += adcxx.o
 obj-$(CONFIG_SENSORS_ADM1021)  += adm1021.o
 obj-$(CONFIG_SENSORS_ADM1025)  += adm1025.o
 obj-$(CONFIG_SENSORS_ADM1026)  += adm1026.o
index f00f497..d568c65 100644 (file)
@@ -1,5 +1,8 @@
 /*
-    abituguru3.c Copyright (c) 2006 Hans de Goede <j.w.r.degoede@hhs.nl>
+    abituguru3.c
+
+    Copyright (c) 2006-2008 Hans de Goede <j.w.r.degoede@hhs.nl>
+    Copyright (c) 2008 Alistair John Strachan <alistair@devzero.co.uk>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -116,7 +119,7 @@ struct abituguru3_sensor_info {
 
 struct abituguru3_motherboard_info {
        u16 id;
-       const char *name;
+       const char *dmi_name;
        /* + 1 -> end of sensors indicated by a sensor with name == NULL */
        struct abituguru3_sensor_info sensors[ABIT_UGURU3_MAX_NO_SENSORS + 1];
 };
@@ -161,7 +164,7 @@ struct abituguru3_data {
 
 /* Constants */
 static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
-       { 0x000C, "unknown", {
+       { 0x000C, NULL /* Unknown, need DMI string */, {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR",                 1, 0, 10, 1, 0 },
                { "DDR VTT",             2, 0, 10, 1, 0 },
@@ -183,7 +186,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX1 Fan",           35, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x000D, "Abit AW8", {
+       { 0x000D, NULL /* Abit AW8, need DMI string */, {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR",                 1, 0, 10, 1, 0 },
                { "DDR VTT",             2, 0, 10, 1, 0 },
@@ -212,7 +215,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX5 Fan",           39, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x000E, "AL-8", {
+       { 0x000E, NULL /* AL-8, need DMI string */, {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR",                 1, 0, 10, 1, 0 },
                { "DDR VTT",             2, 0, 10, 1, 0 },
@@ -233,7 +236,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "SYS Fan",            34, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x000F, "unknown", {
+       { 0x000F, NULL /* Unknown, need DMI string */, {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR",                 1, 0, 10, 1, 0 },
                { "DDR VTT",             2, 0, 10, 1, 0 },
@@ -254,7 +257,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "SYS Fan",            34, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x0010, "Abit NI8 SLI GR", {
+       { 0x0010, NULL /* Abit NI8 SLI GR, need DMI string */, {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR",                 1, 0, 10, 1, 0 },
                { "DDR VTT",             2, 0, 10, 1, 0 },
@@ -276,7 +279,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "OTES1 Fan",          36, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x0011, "Abit AT8 32X", {
+       { 0x0011, NULL /* Abit AT8 32X, need DMI string */, {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR",                 1, 0, 20, 1, 0 },
                { "DDR VTT",             2, 0, 10, 1, 0 },
@@ -302,7 +305,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX2 Fan",           36, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x0012, "Abit AN8 32X", {
+       { 0x0012, NULL /* Abit AN8 32X, need DMI string */, {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR",                 1, 0, 20, 1, 0 },
                { "DDR VTT",             2, 0, 10, 1, 0 },
@@ -324,7 +327,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX1 Fan",           36, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x0013, "Abit AW8D", {
+       { 0x0013, NULL /* Abit AW8D, need DMI string */, {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR",                 1, 0, 10, 1, 0 },
                { "DDR VTT",             2, 0, 10, 1, 0 },
@@ -353,7 +356,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX5 Fan",           39, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x0014, "Abit AB9 Pro", {
+       { 0x0014, NULL /* Abit AB9 Pro, need DMI string */, {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR",                 1, 0, 10, 1, 0 },
                { "DDR VTT",             2, 0, 10, 1, 0 },
@@ -374,7 +377,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "SYS Fan",            34, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x0015, "unknown", {
+       { 0x0015, NULL /* Unknown, need DMI string */, {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR",                 1, 0, 20, 1, 0 },
                { "DDR VTT",             2, 0, 10, 1, 0 },
@@ -398,7 +401,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX3 Fan",           36, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x0016, "AW9D-MAX", {
+       { 0x0016, NULL /* AW9D-MAX, need DMI string */, {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR2",                1, 0, 20, 1, 0 },
                { "DDR2 VTT",            2, 0, 10, 1, 0 },
@@ -426,7 +429,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "OTES1 Fan",          38, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x0017, "unknown", {
+       { 0x0017, NULL /* Unknown, need DMI string */, {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR2",                1, 0, 20, 1, 0 },
                { "DDR2 VTT",            2, 0, 10, 1, 0 },
@@ -451,7 +454,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX3 FAN",           37, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x0018, "unknown", {
+       { 0x0018, NULL /* Unknown, need DMI string */, {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR2",                1, 0, 20, 1, 0 },
                { "DDR2 VTT",            2, 0, 10, 1, 0 },
@@ -478,7 +481,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX3 Fan",           36, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x0019, "unknown", {
+       { 0x0019, NULL /* Unknown, need DMI string */, {
                { "CPU Core",            7, 0, 10, 1, 0 },
                { "DDR2",               13, 0, 20, 1, 0 },
                { "DDR2 VTT",           14, 0, 10, 1, 0 },
@@ -505,7 +508,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX3 FAN",           36, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x001A, "Abit IP35 Pro", {
+       { 0x001A, "IP35 Pro(Intel P35-ICH9R)", {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR2",                1, 0, 20, 1, 0 },
                { "DDR2 VTT",            2, 0, 10, 1, 0 },
@@ -533,7 +536,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX4 Fan",           37, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x001B, "unknown", {
+       { 0x001B, NULL /* Unknown, need DMI string */, {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR3",                1, 0, 20, 1, 0 },
                { "DDR3 VTT",            2, 0, 10, 1, 0 },
@@ -560,7 +563,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX3 Fan",           36, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x001C, "unknown", {
+       { 0x001C, NULL /* Unknown, need DMI string */, {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR2",                1, 0, 20, 1, 0 },
                { "DDR2 VTT",            2, 0, 10, 1, 0 },
@@ -935,9 +938,18 @@ static int __devinit abituguru3_probe(struct platform_device *pdev)
                goto abituguru3_probe_error;
        }
        data->sensors = abituguru3_motherboards[i].sensors;
+
        printk(KERN_INFO ABIT_UGURU3_NAME ": found Abit uGuru3, motherboard "
-               "ID: %04X (%s)\n", (unsigned int)id,
-               abituguru3_motherboards[i].name);
+               "ID: %04X\n", (unsigned int)id);
+
+#ifdef CONFIG_DMI
+       if (!abituguru3_motherboards[i].dmi_name) {
+               printk(KERN_WARNING ABIT_UGURU3_NAME ": this motherboard was "
+                       "not detected using DMI. Please send the output of "
+                       "\"dmidecode\" to the abituguru3 maintainer"
+                       "(see MAINTAINERS)\n");
+       }
+#endif
 
        /* Fill the sysfs attr array */
        sysfs_attr_i = 0;
@@ -1109,6 +1121,46 @@ static struct platform_driver abituguru3_driver = {
        .resume = abituguru3_resume
 };
 
+#ifdef CONFIG_DMI
+
+static int __init abituguru3_dmi_detect(void)
+{
+       const char *board_vendor, *board_name;
+       int i, err = (force) ? 1 : -ENODEV;
+
+       board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
+       if (!board_vendor || strcmp(board_vendor, "http://www.abit.com.tw/"))
+               return err;
+
+       board_name = dmi_get_system_info(DMI_BOARD_NAME);
+       if (!board_name)
+               return err;
+
+       for (i = 0; abituguru3_motherboards[i].id; i++) {
+               const char *dmi_name = abituguru3_motherboards[i].dmi_name;
+               if (dmi_name && !strcmp(dmi_name, board_name))
+                       break;
+       }
+
+       if (!abituguru3_motherboards[i].id)
+               return 1;
+
+       return 0;
+}
+
+#else /* !CONFIG_DMI */
+
+static inline int abituguru3_dmi_detect(void)
+{
+       return -ENODEV;
+}
+
+#endif /* CONFIG_DMI */
+
+/* FIXME: Manual detection should die eventually; we need to collect stable
+ *        DMI model names first before we can rely entirely on CONFIG_DMI.
+ */
+
 static int __init abituguru3_detect(void)
 {
        /* See if there is an uguru3 there. An idle uGuru3 will hold 0x00 or
@@ -1119,7 +1171,7 @@ static int __init abituguru3_detect(void)
        if (((data_val == 0x00) || (data_val == 0x08)) &&
                        ((cmd_val == 0xAC) || (cmd_val == 0x05) ||
                         (cmd_val == 0x55)))
-               return ABIT_UGURU3_BASE;
+               return 0;
 
        ABIT_UGURU3_DEBUG("no Abit uGuru3 found, data = 0x%02X, cmd = "
                "0x%02X\n", (unsigned int)data_val, (unsigned int)cmd_val);
@@ -1127,7 +1179,7 @@ static int __init abituguru3_detect(void)
        if (force) {
                printk(KERN_INFO ABIT_UGURU3_NAME ": Assuming Abit uGuru3 is "
                                "present because of \"force\" parameter\n");
-               return ABIT_UGURU3_BASE;
+               return 0;
        }
 
        /* No uGuru3 found */
@@ -1138,27 +1190,29 @@ static struct platform_device *abituguru3_pdev;
 
 static int __init abituguru3_init(void)
 {
-       int address, err;
        struct resource res = { .flags = IORESOURCE_IO };
-
-#ifdef CONFIG_DMI
-       const char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
-
-       /* safety check, refuse to load on non Abit motherboards */
-       if (!force && (!board_vendor ||
-                       strcmp(board_vendor, "http://www.abit.com.tw/")))
-               return -ENODEV;
-#endif
-
-       address = abituguru3_detect();
-       if (address < 0)
-               return address;
+       int err;
+
+       /* Attempt DMI detection first */
+       err = abituguru3_dmi_detect();
+       if (err < 0)
+               return err;
+
+       /* Fall back to manual detection if there was no exact
+        * board name match, or force was specified.
+        */
+       if (err > 0) {
+               err = abituguru3_detect();
+               if (err)
+                       return err;
+       }
 
        err = platform_driver_register(&abituguru3_driver);
        if (err)
                goto exit;
 
-       abituguru3_pdev = platform_device_alloc(ABIT_UGURU3_NAME, address);
+       abituguru3_pdev = platform_device_alloc(ABIT_UGURU3_NAME,
+                                               ABIT_UGURU3_BASE);
        if (!abituguru3_pdev) {
                printk(KERN_ERR ABIT_UGURU3_NAME
                        ": Device allocation failed\n");
@@ -1166,8 +1220,8 @@ static int __init abituguru3_init(void)
                goto exit_driver_unregister;
        }
 
-       res.start = address;
-       res.end = address + ABIT_UGURU3_REGION_LENGTH - 1;
+       res.start = ABIT_UGURU3_BASE;
+       res.end = ABIT_UGURU3_BASE + ABIT_UGURU3_REGION_LENGTH - 1;
        res.name = ABIT_UGURU3_NAME;
 
        err = platform_device_add_resources(abituguru3_pdev, &res, 1);
diff --git a/drivers/hwmon/adcxx.c b/drivers/hwmon/adcxx.c
new file mode 100644 (file)
index 0000000..242294d
--- /dev/null
@@ -0,0 +1,329 @@
+/*
+ * adcxx.c
+ *
+ * The adcxx4s is an AD converter family from National Semiconductor (NS).
+ *
+ * Copyright (c) 2008 Marc Pignat <marc.pignat@hevs.ch>
+ *
+ * The adcxx4s communicates with a host processor via an SPI/Microwire Bus
+ * interface. This driver supports the whole family of devices with name
+ * ADC<bb><c>S<sss>, where
+ * * bb is the resolution in number of bits (8, 10, 12)
+ * * c is the number of channels (1, 2, 4, 8)
+ * * sss is the maximum conversion speed (021 for 200 kSPS, 051 for 500 kSPS
+ *   and 101 for 1 MSPS)
+ *
+ * Complete datasheets are available at National's website here:
+ * http://www.national.com/ds/DC/ADC<bb><c>S<sss>.pdf
+ *
+ * Handling of 8, 10 and 12 bits converters are the same, the
+ * unavailable bits are 0 :)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/sysfs.h>
+#include <linux/hwmon.h>
+#include <linux/hwmon-sysfs.h>
+#include <linux/mutex.h>
+#include <linux/spi/spi.h>
+
+#define DRVNAME                "adcxx"
+
+struct adcxx {
+       struct device *hwmon_dev;
+       struct mutex lock;
+       u32 channels;
+       u32 reference; /* in millivolts */
+};
+
+/* sysfs hook function */
+static ssize_t adcxx_read(struct device *dev,
+               struct device_attribute *devattr, char *buf)
+{
+       struct spi_device *spi = to_spi_device(dev);
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+       struct adcxx *adc = dev_get_drvdata(&spi->dev);
+       u8 tx_buf[2] = { attr->index << 3 }; /* other bits are don't care */
+       u8 rx_buf[2];
+       int status;
+       int value;
+
+       if (mutex_lock_interruptible(&adc->lock))
+               return -ERESTARTSYS;
+
+       status = spi_write_then_read(spi, tx_buf, sizeof(tx_buf),
+                                       rx_buf, sizeof(rx_buf));
+       if (status < 0) {
+               dev_warn(dev, "spi_write_then_read failed with status %d\n",
+                               status);
+               goto out;
+       }
+
+       value = (rx_buf[0] << 8) + rx_buf[1];
+       dev_dbg(dev, "raw value = 0x%x\n", value);
+
+       value = value * adc->reference >> 12;
+       status = sprintf(buf, "%d\n", value);
+out:
+       mutex_unlock(&adc->lock);
+       return status;
+}
+
+static ssize_t adcxx_show_min(struct device *dev,
+               struct device_attribute *devattr, char *buf)
+{
+       /* The minimum reference is 0 for this chip family */
+       return sprintf(buf, "0\n");
+}
+
+static ssize_t adcxx_show_max(struct device *dev,
+               struct device_attribute *devattr, char *buf)
+{
+       struct spi_device *spi = to_spi_device(dev);
+       struct adcxx *adc = dev_get_drvdata(&spi->dev);
+       u32 reference;
+
+       if (mutex_lock_interruptible(&adc->lock))
+               return -ERESTARTSYS;
+
+       reference = adc->reference;
+
+       mutex_unlock(&adc->lock);
+
+       return sprintf(buf, "%d\n", reference);
+}
+
+static ssize_t adcxx_set_max(struct device *dev,
+       struct device_attribute *devattr, const char *buf, size_t count)
+{
+       struct spi_device *spi = to_spi_device(dev);
+       struct adcxx *adc = dev_get_drvdata(&spi->dev);
+       unsigned long value;
+
+       if (strict_strtoul(buf, 10, &value))
+               return -EINVAL;
+
+       if (mutex_lock_interruptible(&adc->lock))
+               return -ERESTARTSYS;
+
+       adc->reference = value;
+
+       mutex_unlock(&adc->lock);
+
+       return count;
+}
+
+static ssize_t adcxx_show_name(struct device *dev, struct device_attribute
+                             *devattr, char *buf)
+{
+       struct spi_device *spi = to_spi_device(dev);
+       struct adcxx *adc = dev_get_drvdata(&spi->dev);
+
+       return sprintf(buf, "adcxx%ds\n", adc->channels);
+}
+
+static struct sensor_device_attribute ad_input[] = {
+       SENSOR_ATTR(name, S_IRUGO, adcxx_show_name, NULL, 0),
+       SENSOR_ATTR(in_min, S_IRUGO, adcxx_show_min, NULL, 0),
+       SENSOR_ATTR(in_max, S_IWUSR | S_IRUGO, adcxx_show_max,
+                                       adcxx_set_max, 0),
+       SENSOR_ATTR(in0_input, S_IRUGO, adcxx_read, NULL, 0),
+       SENSOR_ATTR(in1_input, S_IRUGO, adcxx_read, NULL, 1),
+       SENSOR_ATTR(in2_input, S_IRUGO, adcxx_read, NULL, 2),
+       SENSOR_ATTR(in3_input, S_IRUGO, adcxx_read, NULL, 3),
+       SENSOR_ATTR(in4_input, S_IRUGO, adcxx_read, NULL, 4),
+       SENSOR_ATTR(in5_input, S_IRUGO, adcxx_read, NULL, 5),
+       SENSOR_ATTR(in6_input, S_IRUGO, adcxx_read, NULL, 6),
+       SENSOR_ATTR(in7_input, S_IRUGO, adcxx_read, NULL, 7),
+};
+
+/*----------------------------------------------------------------------*/
+
+static int __devinit adcxx_probe(struct spi_device *spi, int channels)
+{
+       struct adcxx *adc;
+       int status;
+       int i;
+
+       adc = kzalloc(sizeof *adc, GFP_KERNEL);
+       if (!adc)
+               return -ENOMEM;
+
+       /* set a default value for the reference */
+       adc->reference = 3300;
+       adc->channels = channels;
+       mutex_init(&adc->lock);
+
+       mutex_lock(&adc->lock);
+
+       dev_set_drvdata(&spi->dev, adc);
+
+       for (i = 0; i < 3 + adc->channels; i++) {
+               status = device_create_file(&spi->dev, &ad_input[i].dev_attr);
+               if (status) {
+                       dev_err(&spi->dev, "device_create_file failed.\n");
+                       goto out_err;
+               }
+       }
+
+       adc->hwmon_dev = hwmon_device_register(&spi->dev);
+       if (IS_ERR(adc->hwmon_dev)) {
+               dev_err(&spi->dev, "hwmon_device_register failed.\n");
+               status = PTR_ERR(adc->hwmon_dev);
+               goto out_err;
+       }
+
+       mutex_unlock(&adc->lock);
+       return 0;
+
+out_err:
+       for (i--; i >= 0; i--)
+               device_remove_file(&spi->dev, &ad_input[i].dev_attr);
+
+       dev_set_drvdata(&spi->dev, NULL);
+       mutex_unlock(&adc->lock);
+       kfree(adc);
+       return status;
+}
+
+static int __devinit adcxx1s_probe(struct spi_device *spi)
+{
+       return adcxx_probe(spi, 1);
+}
+
+static int __devinit adcxx2s_probe(struct spi_device *spi)
+{
+       return adcxx_probe(spi, 2);
+}
+
+static int __devinit adcxx4s_probe(struct spi_device *spi)
+{
+       return adcxx_probe(spi, 4);
+}
+
+static int __devinit adcxx8s_probe(struct spi_device *spi)
+{
+       return adcxx_probe(spi, 8);
+}
+
+static int __devexit adcxx_remove(struct spi_device *spi)
+{
+       struct adcxx *adc = dev_get_drvdata(&spi->dev);
+       int i;
+
+       mutex_lock(&adc->lock);
+       hwmon_device_unregister(adc->hwmon_dev);
+       for (i = 0; i < 3 + adc->channels; i++)
+               device_remove_file(&spi->dev, &ad_input[i].dev_attr);
+
+       dev_set_drvdata(&spi->dev, NULL);
+       mutex_unlock(&adc->lock);
+       kfree(adc);
+
+       return 0;
+}
+
+static struct spi_driver adcxx1s_driver = {
+       .driver = {
+               .name   = "adcxx1s",
+               .owner  = THIS_MODULE,
+       },
+       .probe  = adcxx1s_probe,
+       .remove = __devexit_p(adcxx_remove),
+};
+
+static struct spi_driver adcxx2s_driver = {
+       .driver = {
+               .name   = "adcxx2s",
+               .owner  = THIS_MODULE,
+       },
+       .probe  = adcxx2s_probe,
+       .remove = __devexit_p(adcxx_remove),
+};
+
+static struct spi_driver adcxx4s_driver = {
+       .driver = {
+               .name   = "adcxx4s",
+               .owner  = THIS_MODULE,
+       },
+       .probe  = adcxx4s_probe,
+       .remove = __devexit_p(adcxx_remove),
+};
+
+static struct spi_driver adcxx8s_driver = {
+       .driver = {
+               .name   = "adcxx8s",
+               .owner  = THIS_MODULE,
+       },
+       .probe  = adcxx8s_probe,
+       .remove = __devexit_p(adcxx_remove),
+};
+
+static int __init init_adcxx(void)
+{
+       int status;
+       status = spi_register_driver(&adcxx1s_driver);
+       if (status)
+               goto reg_1_failed;
+
+       status = spi_register_driver(&adcxx2s_driver);
+       if (status)
+               goto reg_2_failed;
+
+       status = spi_register_driver(&adcxx4s_driver);
+       if (status)
+               goto reg_4_failed;
+
+       status = spi_register_driver(&adcxx8s_driver);
+       if (status)
+               goto reg_8_failed;
+
+       return status;
+
+reg_8_failed:
+       spi_unregister_driver(&adcxx4s_driver);
+reg_4_failed:
+       spi_unregister_driver(&adcxx2s_driver);
+reg_2_failed:
+       spi_unregister_driver(&adcxx1s_driver);
+reg_1_failed:
+       return status;
+}
+
+static void __exit exit_adcxx(void)
+{
+       spi_unregister_driver(&adcxx1s_driver);
+       spi_unregister_driver(&adcxx2s_driver);
+       spi_unregister_driver(&adcxx4s_driver);
+       spi_unregister_driver(&adcxx8s_driver);
+}
+
+module_init(init_adcxx);
+module_exit(exit_adcxx);
+
+MODULE_AUTHOR("Marc Pignat");
+MODULE_DESCRIPTION("National Semiconductor adcxx8sxxx Linux driver");
+MODULE_LICENSE("GPL");
+
+MODULE_ALIAS("adcxx1s");
+MODULE_ALIAS("adcxx2s");
+MODULE_ALIAS("adcxx4s");
+MODULE_ALIAS("adcxx8s");
index aacc0c4..b06b8e0 100644 (file)
@@ -98,6 +98,12 @@ static const char* temperature_sensors_sets[][36] = {
          "TH1P", "TH2P", "TH3P", "TMAP", "TMAS", "TMBS", "TM0P", "TM0S",
          "TM1P", "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", "TM8S", "TM9P",
          "TM9S", "TN0H", "TS0C", NULL },
+/* Set 5: iMac */
+       { "TC0D", "TA0P", "TG0P", "TG0D", "TG0H", "TH0P", "Tm0P", "TO0P",
+         "Tp0C", NULL },
+/* Set 6: Macbook3 set */
+       { "TB0T", "TC0D", "TC0P", "TM0P", "TN0P", "TTF0", "TW0P", "Th0H",
+         "Th0S", "Th1H", NULL },
 };
 
 /* List of keys used to read/write fan speeds */
@@ -1223,6 +1229,10 @@ static __initdata struct dmi_match_data applesmc_dmi_data[] = {
        { .accelerometer = 0, .light = 0, .temperature_set = 3 },
 /* MacPro: temperature set 4 */
        { .accelerometer = 0, .light = 0, .temperature_set = 4 },
+/* iMac: temperature set 5 */
+       { .accelerometer = 0, .light = 0, .temperature_set = 5 },
+/* MacBook3: accelerometer and temperature set 6 */
+       { .accelerometer = 1, .light = 0, .temperature_set = 6 },
 };
 
 /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1".
@@ -1232,10 +1242,14 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = {
          DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
          DMI_MATCH(DMI_PRODUCT_NAME,"MacBookPro") },
                (void*)&applesmc_dmi_data[0]},
-       { applesmc_dmi_match, "Apple MacBook", {
+       { applesmc_dmi_match, "Apple MacBook (v2)", {
          DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
          DMI_MATCH(DMI_PRODUCT_NAME,"MacBook2") },
                (void*)&applesmc_dmi_data[1]},
+       { applesmc_dmi_match, "Apple MacBook (v3)", {
+         DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
+         DMI_MATCH(DMI_PRODUCT_NAME,"MacBook3") },
+               (void*)&applesmc_dmi_data[6]},
        { applesmc_dmi_match, "Apple MacBook", {
          DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
          DMI_MATCH(DMI_PRODUCT_NAME,"MacBook") },
@@ -1248,6 +1262,10 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = {
          DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
          DMI_MATCH(DMI_PRODUCT_NAME,"MacPro2") },
                (void*)&applesmc_dmi_data[4]},
+       { applesmc_dmi_match, "Apple iMac", {
+         DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
+         DMI_MATCH(DMI_PRODUCT_NAME,"iMac") },
+               (void*)&applesmc_dmi_data[5]},
        { .ident = NULL }
 };
 
index 70239ac..93c1722 100644 (file)
@@ -413,10 +413,11 @@ static int __init coretemp_init(void)
        for_each_online_cpu(i) {
                struct cpuinfo_x86 *c = &cpu_data(i);
 
-               /* check if family 6, models 0xe, 0xf, 0x16, 0x17 */
+               /* check if family 6, models 0xe, 0xf, 0x16, 0x17, 0x1A */
                if ((c->cpuid_level < 0) || (c->x86 != 0x6) ||
                    !((c->x86_model == 0xe) || (c->x86_model == 0xf) ||
-                       (c->x86_model == 0x16) || (c->x86_model == 0x17))) {
+                       (c->x86_model == 0x16) || (c->x86_model == 0x17) ||
+                       (c->x86_model == 0x1A))) {
 
                        /* supported CPU not found, but report the unknown
                           family 6 CPU */
index 7b0a32c..c54eff9 100644 (file)
  * For VRD 10.0 and up, "VRD x.y Design Guide",
  * available at http://developer.intel.com/.
  *
- * AMD NPT 0Fh (Athlon64 & Opteron), AMD Publication 32559,
+ * AMD Athlon 64 and AMD Opteron Processors, AMD Publication 26094,
+ * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/26094.PDF
+ * Table 74. VID Code Voltages
+ * This corresponds to an arbitrary VRM code of 24 in the functions below.
+ * These CPU models (K8 revision <= E) have 5 VID pins. See also:
+ * Revision Guide for AMD Athlon 64 and AMD Opteron Processors, AMD Publication 25759,
+ * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/25759.pdf
+ *
+ * AMD NPT Family 0Fh Processors, AMD Publication 32559,
  * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf
  * Table 71. VID Code Voltages
- * AMD Opteron processors don't follow the Intel specifications.
- * I'm going to "make up" 2.4 as the spec number for the Opterons.
- * No good reason just a mnemonic for the 24x Opteron processor
- * series.
+ * This corresponds to an arbitrary VRM code of 25 in the functions below.
+ * These CPU models (K8 revision >= F) have 6 VID pins. See also:
+ * Revision Guide for AMD NPT Family 0Fh Processors, AMD Publication 33610,
+ * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/33610.pdf
  *
  * The 17 specification is in fact Intel Mobile Voltage Positioning -
  * (IMVP-II). You can find more information in the datasheet of Max1718
@@ -95,7 +103,12 @@ int vid_from_reg(int val, u8 vrm)
                        return 0;
                return((1600000 - (val - 2) * 6250 + 500) / 1000);
 
-       case 24:                /* AMD NPT 0Fh (Athlon64 & Opteron) */
+       case 24:                /* Athlon64 & Opteron */
+               val &= 0x1f;
+               if (val == 0x1f)
+                       return 0;
+                               /* fall through */
+       case 25:                /* AMD NPT 0Fh */
                val &= 0x3f;
                return (val < 32) ? 1550 - 25 * val
                        : 775 - (25 * (val - 31)) / 2;
@@ -157,11 +170,16 @@ struct vrm_model {
 
 #ifdef CONFIG_X86
 
-/* the stepping parameter is highest acceptable stepping for current line */
+/*
+ * The stepping parameter is highest acceptable stepping for current line.
+ * The model match must be exact for 4-bit values. For model values 0x10
+ * and above (extended model), all models below the parameter will match.
+ */
 
 static struct vrm_model vrm_models[] = {
        {X86_VENDOR_AMD, 0x6, ANY, ANY, 90},            /* Athlon Duron etc */
-       {X86_VENDOR_AMD, 0xF, ANY, ANY, 24},            /* Athlon 64, Opteron and above VRM 24 */
+       {X86_VENDOR_AMD, 0xF, 0x3F, ANY, 24},           /* Athlon 64, Opteron */
+       {X86_VENDOR_AMD, 0xF, ANY, ANY, 25},            /* NPT family 0Fh */
        {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 13},          /* Pentium M (130 nm) */
        {X86_VENDOR_INTEL, 0x6, 0xB, ANY, 85},          /* Tualatin */
        {X86_VENDOR_INTEL, 0x6, 0xD, ANY, 13},          /* Pentium M (90 nm) */
@@ -189,6 +207,8 @@ static u8 find_vrm(u8 eff_family, u8 eff_model, u8 eff_stepping, u8 vendor)
                if (vrm_models[i].vendor==vendor)
                        if ((vrm_models[i].eff_family==eff_family)
                         && ((vrm_models[i].eff_model==eff_model) ||
+                            (vrm_models[i].eff_model >= 0x10 &&
+                             eff_model <= vrm_models[i].eff_model) ||
                             (vrm_models[i].eff_model==ANY)) &&
                             (eff_stepping <= vrm_models[i].eff_stepping))
                                return vrm_models[i].vrm_type;
index f9e2ed6..2ede938 100644 (file)
@@ -81,6 +81,8 @@ static unsigned long amb_reg_temp(unsigned int amb)
 #define MAX_AMBS_PER_CHANNEL           16
 #define MAX_AMBS                       (MAX_MEM_CHANNELS * \
                                         MAX_AMBS_PER_CHANNEL)
+#define CHANNEL_SHIFT                  4
+#define DIMM_MASK                      0xF
 /*
  * Ugly hack: For some reason the highest bit is set if there
  * are _any_ DIMMs in the channel.  Attempting to read from
@@ -89,7 +91,7 @@ static unsigned long amb_reg_temp(unsigned int amb)
  * might prevent us from seeing the 16th DIMM in the channel.
  */
 #define REAL_MAX_AMBS_PER_CHANNEL      15
-#define KNOBS_PER_AMB                  5
+#define KNOBS_PER_AMB                  6
 
 static unsigned long amb_num_from_reg(unsigned int byte_num, unsigned int bit)
 {
@@ -238,6 +240,16 @@ static ssize_t show_amb_temp(struct device *dev,
                500 * amb_read_byte(data, amb_reg_temp(attr->index)));
 }
 
+static ssize_t show_label(struct device *dev,
+                         struct device_attribute *devattr,
+                         char *buf)
+{
+       struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+
+       return sprintf(buf, "Ch. %d DIMM %d\n", attr->index >> CHANNEL_SHIFT,
+                      attr->index & DIMM_MASK);
+}
+
 static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
 {
        int i, j, k, d = 0;
@@ -268,6 +280,20 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
                                continue;
                        d++;
 
+                       /* sysfs label */
+                       iattr = data->attrs + data->num_attrs;
+                       snprintf(iattr->name, AMB_SYSFS_NAME_LEN,
+                                "temp%d_label", d);
+                       iattr->s_attr.dev_attr.attr.name = iattr->name;
+                       iattr->s_attr.dev_attr.attr.mode = S_IRUGO;
+                       iattr->s_attr.dev_attr.show = show_label;
+                       iattr->s_attr.index = k;
+                       res = device_create_file(&pdev->dev,
+                                                &iattr->s_attr.dev_attr);
+                       if (res)
+                               goto exit_remove;
+                       data->num_attrs++;
+
                        /* Temperature sysfs knob */
                        iattr = data->attrs + data->num_attrs;
                        snprintf(iattr->name, AMB_SYSFS_NAME_LEN,
index c9416e6..0f70dc2 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * A hwmon driver for the IBM Active Energy Manager temperature/power sensors
- * and capping functionality.
+ * A hwmon driver for the IBM System Director Active Energy Manager (AEM)
+ * temperature/power/energy sensors and capping functionality.
  * Copyright (C) 2008 IBM
  *
  * Author: Darrick J. Wong <djwong@us.ibm.com>
@@ -463,12 +463,18 @@ static int aem_read_sensor(struct aem_data *data, u8 elt, u8 reg,
 }
 
 /* Update AEM energy registers */
+static void update_aem_energy_one(struct aem_data *data, int which)
+{
+       aem_read_sensor(data, AEM_ENERGY_ELEMENT, which,
+                       &data->energy[which], 8);
+}
+
 static void update_aem_energy(struct aem_data *data)
 {
-       aem_read_sensor(data, AEM_ENERGY_ELEMENT, 0, &data->energy[0], 8);
+       update_aem_energy_one(data, 0);
        if (data->ver_major < 2)
                return;
-       aem_read_sensor(data, AEM_ENERGY_ELEMENT, 1, &data->energy[1], 8);
+       update_aem_energy_one(data, 1);
 }
 
 /* Update all AEM1 sensors */
@@ -676,7 +682,8 @@ static int aem_find_aem2(struct aem_ipmi_data *data,
                return -ETIMEDOUT;
 
        if (data->rx_result || data->rx_msg_len != sizeof(*fi_resp) ||
-           memcmp(&fi_resp->id, &system_x_id, sizeof(system_x_id)))
+           memcmp(&fi_resp->id, &system_x_id, sizeof(system_x_id)) ||
+           fi_resp->num_instances <= instance_num)
                return -ENOENT;
 
        return 0;
@@ -849,7 +856,7 @@ static ssize_t aem_show_power(struct device *dev,
        struct timespec b, a;
 
        mutex_lock(&data->lock);
-       update_aem_energy(data);
+       update_aem_energy_one(data, attr->index);
        getnstimeofday(&b);
        before = data->energy[attr->index];
 
@@ -861,7 +868,7 @@ static ssize_t aem_show_power(struct device *dev,
                return 0;
        }
 
-       update_aem_energy(data);
+       update_aem_energy_one(data, attr->index);
        getnstimeofday(&a);
        after = data->energy[attr->index];
        mutex_unlock(&data->lock);
@@ -880,7 +887,9 @@ static ssize_t aem_show_energy(struct device *dev,
 {
        struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
        struct aem_data *a = dev_get_drvdata(dev);
-       a->update(a);
+       mutex_lock(&a->lock);
+       update_aem_energy_one(a, attr->index);
+       mutex_unlock(&a->lock);
 
        return sprintf(buf, "%llu\n",
                        (unsigned long long)a->energy[attr->index] * 1000);
@@ -1104,7 +1113,7 @@ static void __exit aem_exit(void)
 }
 
 MODULE_AUTHOR("Darrick J. Wong <djwong@us.ibm.com>");
-MODULE_DESCRIPTION("IBM Active Energy Manager power/temp sensor driver");
+MODULE_DESCRIPTION("IBM AEM power/temp/energy sensor driver");
 MODULE_LICENSE("GPL");
 
 module_init(aem_init);
index daa7d12..de21142 100644 (file)
@@ -1055,9 +1055,10 @@ static int w83791d_probe(struct i2c_client *client,
 {
        struct w83791d_data *data;
        struct device *dev = &client->dev;
-       int i, val1, err;
+       int i, err;
 
 #ifdef DEBUG
+       int val1;
        val1 = w83791d_read(client, W83791D_REG_DID_VID4);
        dev_dbg(dev, "Device ID version: %d.%d (0x%02x)\n",
                        (val1 >> 5) & 0x07, (val1 >> 1) & 0x0f, val1);
index 2d65411..a92d815 100644 (file)
@@ -647,6 +647,47 @@ static int str_to_user(const char *str, unsigned int maxlen, void __user *p)
        return copy_to_user(p, str, len) ? -EFAULT : len;
 }
 
+#define OLD_KEY_MAX    0x1ff
+static int handle_eviocgbit(struct input_dev *dev, unsigned int cmd, void __user *p, int compat_mode)
+{
+       static unsigned long keymax_warn_time;
+       unsigned long *bits;
+       int len;
+
+       switch (_IOC_NR(cmd) & EV_MAX) {
+
+       case      0: bits = dev->evbit;  len = EV_MAX;  break;
+       case EV_KEY: bits = dev->keybit; len = KEY_MAX; break;
+       case EV_REL: bits = dev->relbit; len = REL_MAX; break;
+       case EV_ABS: bits = dev->absbit; len = ABS_MAX; break;
+       case EV_MSC: bits = dev->mscbit; len = MSC_MAX; break;
+       case EV_LED: bits = dev->ledbit; len = LED_MAX; break;
+       case EV_SND: bits = dev->sndbit; len = SND_MAX; break;
+       case EV_FF:  bits = dev->ffbit;  len = FF_MAX;  break;
+       case EV_SW:  bits = dev->swbit;  len = SW_MAX;  break;
+       default: return -EINVAL;
+       }
+
+       /*
+        * Work around bugs in userspace programs that like to do
+        * EVIOCGBIT(EV_KEY, KEY_MAX) and not realize that 'len'
+        * should be in bytes, not in bits.
+        */
+       if ((_IOC_NR(cmd) & EV_MAX) == EV_KEY && _IOC_SIZE(cmd) == OLD_KEY_MAX) {
+               len = OLD_KEY_MAX;
+               if (printk_timed_ratelimit(&keymax_warn_time, 10 * 1000))
+                       printk(KERN_WARNING
+                               "evdev.c(EVIOCGBIT): Suspicious buffer size %d, "
+                               "limiting output to %d bytes. See "
+                               "http://userweb.kernel.org/~dtor/eviocgbit-bug.html\n",
+                               OLD_KEY_MAX,
+                               BITS_TO_LONGS(OLD_KEY_MAX) * sizeof(long));
+       }
+
+       return bits_to_user(bits, len, _IOC_SIZE(cmd), p, compat_mode);
+}
+#undef OLD_KEY_MAX
+
 static long evdev_do_ioctl(struct file *file, unsigned int cmd,
                           void __user *p, int compat_mode)
 {
@@ -733,26 +774,8 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
 
                if (_IOC_DIR(cmd) == _IOC_READ) {
 
-                       if ((_IOC_NR(cmd) & ~EV_MAX) == _IOC_NR(EVIOCGBIT(0, 0))) {
-
-                               unsigned long *bits;
-                               int len;
-
-                               switch (_IOC_NR(cmd) & EV_MAX) {
-
-                               case      0: bits = dev->evbit;  len = EV_MAX;  break;
-                               case EV_KEY: bits = dev->keybit; len = KEY_MAX; break;
-                               case EV_REL: bits = dev->relbit; len = REL_MAX; break;
-                               case EV_ABS: bits = dev->absbit; len = ABS_MAX; break;
-                               case EV_MSC: bits = dev->mscbit; len = MSC_MAX; break;
-                               case EV_LED: bits = dev->ledbit; len = LED_MAX; break;
-                               case EV_SND: bits = dev->sndbit; len = SND_MAX; break;
-                               case EV_FF:  bits = dev->ffbit;  len = FF_MAX;  break;
-                               case EV_SW:  bits = dev->swbit;  len = SW_MAX;  break;
-                               default: return -EINVAL;
-                               }
-                               return bits_to_user(bits, len, _IOC_SIZE(cmd), p, compat_mode);
-                       }
+                       if ((_IOC_NR(cmd) & ~EV_MAX) == _IOC_NR(EVIOCGBIT(0, 0)))
+                               return handle_eviocgbit(dev, cmd, p, compat_mode);
 
                        if (_IOC_NR(cmd) == _IOC_NR(EVIOCGKEY(0)))
                                return bits_to_user(dev->key, KEY_MAX, _IOC_SIZE(cmd),
index 87d3e7e..6791be8 100644 (file)
@@ -127,6 +127,7 @@ static const struct xpad_device {
        { 0x0738, 0x4716, "Mad Catz Wired Xbox 360 Controller", MAP_DPAD_TO_AXES, XTYPE_XBOX360 },
        { 0x0738, 0x6040, "Mad Catz Beat Pad Pro", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
        { 0x0c12, 0x8802, "Zeroplus Xbox Controller", MAP_DPAD_TO_AXES, XTYPE_XBOX },
+       { 0x0c12, 0x880a, "Pelican Eclipse PL-2023", MAP_DPAD_TO_AXES, XTYPE_XBOX },
        { 0x0c12, 0x8810, "Zeroplus Xbox Controller", MAP_DPAD_TO_AXES, XTYPE_XBOX },
        { 0x0c12, 0x9902, "HAMA VibraX - *FAULTY HARDWARE*", MAP_DPAD_TO_AXES, XTYPE_XBOX },
        { 0x0e4c, 0x1097, "Radica Gamester Controller", MAP_DPAD_TO_AXES, XTYPE_XBOX },
index be58730..3f48279 100644 (file)
@@ -118,6 +118,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
                unsigned int type = button->type ?: EV_KEY;
 
                bdata->input = input;
+               bdata->button = button;
                setup_timer(&bdata->timer,
                            gpio_check_button, (unsigned long)bdata);
 
@@ -256,7 +257,7 @@ static int gpio_keys_resume(struct platform_device *pdev)
 #define gpio_keys_resume       NULL
 #endif
 
-struct platform_driver gpio_keys_device_driver = {
+static struct platform_driver gpio_keys_device_driver = {
        .probe          = gpio_keys_probe,
        .remove         = __devexit_p(gpio_keys_remove),
        .suspend        = gpio_keys_suspend,
index 7bbea09..f996546 100644 (file)
@@ -130,6 +130,29 @@ config MOUSE_APPLETOUCH
          To compile this driver as a module, choose M here: the
          module will be called appletouch.
 
+config MOUSE_BCM5974
+       tristate "Apple USB BCM5974 Multitouch trackpad support"
+       depends on USB_ARCH_HAS_HCD
+       select USB
+       help
+         Say Y here if you have an Apple USB BCM5974 Multitouch
+         trackpad.
+
+         The BCM5974 is the multitouch trackpad found in the Macbook
+         Air (JAN2008) and Macbook Pro Penryn (FEB2008) laptops.
+
+         It is also found in the IPhone (2007) and Ipod Touch (2008).
+
+         This driver provides multitouch functionality together with
+         the synaptics X11 driver.
+
+         The interface is currently identical to the appletouch interface,
+         for further information, see
+         <file:Documentation/input/appletouch.txt>.
+
+         To compile this driver as a module, choose M here: the
+         module will be called bcm5974.
+
 config MOUSE_INPORT
        tristate "InPort/MS/ATIXL busmouse"
        depends on ISA
index 9e6e363..d4d2025 100644 (file)
@@ -6,6 +6,7 @@
 
 obj-$(CONFIG_MOUSE_AMIGA)      += amimouse.o
 obj-$(CONFIG_MOUSE_APPLETOUCH) += appletouch.o
+obj-$(CONFIG_MOUSE_BCM5974)    += bcm5974.o
 obj-$(CONFIG_MOUSE_ATARI)      += atarimouse.o
 obj-$(CONFIG_MOUSE_RISCPC)     += rpcmouse.o
 obj-$(CONFIG_MOUSE_INPORT)     += inport.o
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
new file mode 100644 (file)
index 0000000..2ec921b
--- /dev/null
@@ -0,0 +1,681 @@
+/*
+ * Apple USB BCM5974 (Macbook Air and Penryn Macbook Pro) multitouch driver
+ *
+ * Copyright (C) 2008     Henrik Rydberg (rydberg@euromail.se)
+ *
+ * The USB initialization and package decoding was made by
+ * Scott Shawcroft as part of the touchd user-space driver project:
+ * Copyright (C) 2008     Scott Shawcroft (scott.shawcroft@gmail.com)
+ *
+ * The BCM5974 driver is based on the appletouch driver:
+ * Copyright (C) 2001-2004 Greg Kroah-Hartman (greg@kroah.com)
+ * Copyright (C) 2005      Johannes Berg (johannes@sipsolutions.net)
+ * Copyright (C) 2005     Stelian Pop (stelian@popies.net)
+ * Copyright (C) 2005     Frank Arnold (frank@scirocco-5v-turbo.de)
+ * Copyright (C) 2005     Peter Osterlund (petero2@telia.com)
+ * Copyright (C) 2005     Michael Hanselmann (linux-kernel@hansmi.ch)
+ * Copyright (C) 2006     Nicolas Boichat (nicolas@boichat.ch)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/module.h>
+#include <linux/usb/input.h>
+#include <linux/hid.h>
+#include <linux/mutex.h>
+
+#define USB_VENDOR_ID_APPLE            0x05ac
+
+/* MacbookAir, aka wellspring */
+#define USB_DEVICE_ID_APPLE_WELLSPRING_ANSI    0x0223
+#define USB_DEVICE_ID_APPLE_WELLSPRING_ISO     0x0224
+#define USB_DEVICE_ID_APPLE_WELLSPRING_JIS     0x0225
+/* MacbookProPenryn, aka wellspring2 */
+#define USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI   0x0230
+#define USB_DEVICE_ID_APPLE_WELLSPRING2_ISO    0x0231
+#define USB_DEVICE_ID_APPLE_WELLSPRING2_JIS    0x0232
+
+#define BCM5974_DEVICE(prod) {                                 \
+       .match_flags = (USB_DEVICE_ID_MATCH_DEVICE |            \
+                       USB_DEVICE_ID_MATCH_INT_CLASS |         \
+                       USB_DEVICE_ID_MATCH_INT_PROTOCOL),      \
+       .idVendor = USB_VENDOR_ID_APPLE,                        \
+       .idProduct = (prod),                                    \
+       .bInterfaceClass = USB_INTERFACE_CLASS_HID,             \
+       .bInterfaceProtocol = USB_INTERFACE_PROTOCOL_MOUSE      \
+}
+
+/* table of devices that work with this driver */
+static const struct usb_device_id bcm5974_table [] = {
+       /* MacbookAir1.1 */
+       BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING_ANSI),
+       BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING_ISO),
+       BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING_JIS),
+       /* MacbookProPenryn */
+       BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI),
+       BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING2_ISO),
+       BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING2_JIS),
+       /* Terminating entry */
+       {}
+};
+MODULE_DEVICE_TABLE(usb, bcm5974_table);
+
+MODULE_AUTHOR("Henrik Rydberg");
+MODULE_DESCRIPTION("Apple USB BCM5974 multitouch driver");
+MODULE_LICENSE("GPL");
+
+#define dprintk(level, format, a...)\
+       { if (debug >= level) printk(KERN_DEBUG format, ##a); }
+
+static int debug = 1;
+module_param(debug, int, 0644);
+MODULE_PARM_DESC(debug, "Activate debugging output");
+
+/* button data structure */
+struct bt_data {
+       u8 unknown1;            /* constant */
+       u8 button;              /* left button */
+       u8 rel_x;               /* relative x coordinate */
+       u8 rel_y;               /* relative y coordinate */
+};
+
+/* trackpad header structure */
+struct tp_header {
+       u8 unknown1[16];        /* constants, timers, etc */
+       u8 fingers;             /* number of fingers on trackpad */
+       u8 unknown2[9];         /* constants, timers, etc */
+};
+
+/* trackpad finger structure */
+struct tp_finger {
+       __le16 origin;          /* left/right origin? */
+       __le16 abs_x;           /* absolute x coodinate */
+       __le16 abs_y;           /* absolute y coodinate */
+       __le16 rel_x;           /* relative x coodinate */
+       __le16 rel_y;           /* relative y coodinate */
+       __le16 size_major;      /* finger size, major axis? */
+       __le16 size_minor;      /* finger size, minor axis? */
+       __le16 orientation;     /* 16384 when point, else 15 bit angle */
+       __le16 force_major;     /* trackpad force, major axis? */
+       __le16 force_minor;     /* trackpad force, minor axis? */
+       __le16 unused[3];       /* zeros */
+       __le16 multi;           /* one finger: varies, more fingers: constant */
+};
+
+/* trackpad data structure, empirically at least ten fingers */
+struct tp_data {
+       struct tp_header header;
+       struct tp_finger finger[16];
+};
+
+/* device-specific parameters */
+struct bcm5974_param {
+       int dim;                /* logical dimension */
+       int fuzz;               /* logical noise value */
+       int devmin;             /* device minimum reading */
+       int devmax;             /* device maximum reading */
+};
+
+/* device-specific configuration */
+struct bcm5974_config {
+       int ansi, iso, jis;     /* the product id of this device */
+       int bt_ep;              /* the endpoint of the button interface */
+       int bt_datalen;         /* data length of the button interface */
+       int tp_ep;              /* the endpoint of the trackpad interface */
+       int tp_datalen;         /* data length of the trackpad interface */
+       struct bcm5974_param p; /* finger pressure limits */
+       struct bcm5974_param w; /* finger width limits */
+       struct bcm5974_param x; /* horizontal limits */
+       struct bcm5974_param y; /* vertical limits */
+};
+
+/* logical device structure */
+struct bcm5974 {
+       char phys[64];
+       struct usb_device *udev;        /* usb device */
+       struct usb_interface *intf;     /* our interface */
+       struct input_dev *input;        /* input dev */
+       struct bcm5974_config cfg;      /* device configuration */
+       struct mutex pm_mutex;          /* serialize access to open/suspend */
+       int opened;                     /* 1: opened, 0: closed */
+       struct urb *bt_urb;             /* button usb request block */
+       struct bt_data *bt_data;        /* button transferred data */
+       struct urb *tp_urb;             /* trackpad usb request block */
+       struct tp_data *tp_data;        /* trackpad transferred data */
+};
+
+/* logical dimensions */
+#define DIM_PRESSURE   256             /* maximum finger pressure */
+#define DIM_WIDTH      16              /* maximum finger width */
+#define DIM_X          1280            /* maximum trackpad x value */
+#define DIM_Y          800             /* maximum trackpad y value */
+
+/* logical signal quality */
+#define SN_PRESSURE    45              /* pressure signal-to-noise ratio */
+#define SN_WIDTH       100             /* width signal-to-noise ratio */
+#define SN_COORD       250             /* coordinate signal-to-noise ratio */
+
+/* device constants */
+static const struct bcm5974_config bcm5974_config_table[] = {
+       {
+               USB_DEVICE_ID_APPLE_WELLSPRING_ANSI,
+               USB_DEVICE_ID_APPLE_WELLSPRING_ISO,
+               USB_DEVICE_ID_APPLE_WELLSPRING_JIS,
+               0x84, sizeof(struct bt_data),
+               0x81, sizeof(struct tp_data),
+               { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 256 },
+               { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 },
+               { DIM_X, DIM_X / SN_COORD, -4824, 5342 },
+               { DIM_Y, DIM_Y / SN_COORD, -172, 5820 }
+       },
+       {
+               USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI,
+               USB_DEVICE_ID_APPLE_WELLSPRING2_ISO,
+               USB_DEVICE_ID_APPLE_WELLSPRING2_JIS,
+               0x84, sizeof(struct bt_data),
+               0x81, sizeof(struct tp_data),
+               { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 256 },
+               { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 },
+               { DIM_X, DIM_X / SN_COORD, -4824, 4824 },
+               { DIM_Y, DIM_Y / SN_COORD, -172, 4290 }
+       },
+       {}
+};
+
+/* return the device-specific configuration by device */
+static const struct bcm5974_config *bcm5974_get_config(struct usb_device *udev)
+{
+       u16 id = le16_to_cpu(udev->descriptor.idProduct);
+       const struct bcm5974_config *cfg;
+
+       for (cfg = bcm5974_config_table; cfg->ansi; ++cfg)
+               if (cfg->ansi == id || cfg->iso == id || cfg->jis == id)
+                       return cfg;
+
+       return bcm5974_config_table;
+}
+
+/* convert 16-bit little endian to signed integer */
+static inline int raw2int(__le16 x)
+{
+       return (signed short)le16_to_cpu(x);
+}
+
+/* scale device data to logical dimensions (asserts devmin < devmax) */
+static inline int int2scale(const struct bcm5974_param *p, int x)
+{
+       return x * p->dim / (p->devmax - p->devmin);
+}
+
+/* all logical value ranges are [0,dim). */
+static inline int int2bound(const struct bcm5974_param *p, int x)
+{
+       int s = int2scale(p, x);
+
+       return clamp_val(s, 0, p->dim - 1);
+}
+
+/* setup which logical events to report */
+static void setup_events_to_report(struct input_dev *input_dev,
+                                  const struct bcm5974_config *cfg)
+{
+       __set_bit(EV_ABS, input_dev->evbit);
+
+       input_set_abs_params(input_dev, ABS_PRESSURE,
+                               0, cfg->p.dim, cfg->p.fuzz, 0);
+       input_set_abs_params(input_dev, ABS_TOOL_WIDTH,
+                               0, cfg->w.dim, cfg->w.fuzz, 0);
+       input_set_abs_params(input_dev, ABS_X,
+                               0, cfg->x.dim, cfg->x.fuzz, 0);
+       input_set_abs_params(input_dev, ABS_Y,
+                               0, cfg->y.dim, cfg->y.fuzz, 0);
+
+       __set_bit(EV_KEY, input_dev->evbit);
+       __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
+       __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
+       __set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit);
+       __set_bit(BTN_LEFT, input_dev->keybit);
+}
+
+/* report button data as logical button state */
+static int report_bt_state(struct bcm5974 *dev, int size)
+{
+       if (size != sizeof(struct bt_data))
+               return -EIO;
+
+       input_report_key(dev->input, BTN_LEFT, dev->bt_data->button);
+       input_sync(dev->input);
+
+       return 0;
+}
+
+/* report trackpad data as logical trackpad state */
+static int report_tp_state(struct bcm5974 *dev, int size)
+{
+       const struct bcm5974_config *c = &dev->cfg;
+       const struct tp_finger *f = dev->tp_data->finger;
+       struct input_dev *input = dev->input;
+       const int fingers = (size - 26) / 28;
+       int p = 0, w, x, y, n = 0;
+
+       if (size < 26 || (size - 26) % 28 != 0)
+               return -EIO;
+
+       if (fingers) {
+               p = raw2int(f->force_major);
+               w = raw2int(f->size_major);
+               x = raw2int(f->abs_x);
+               y = raw2int(f->abs_y);
+               n = p > 0 ? fingers : 0;
+
+               dprintk(9,
+                       "bcm5974: p: %+05d w: %+05d x: %+05d y: %+05d n: %d\n",
+                       p, w, x, y, n);
+
+               input_report_abs(input, ABS_TOOL_WIDTH, int2bound(&c->w, w));
+               input_report_abs(input, ABS_X, int2bound(&c->x, x - c->x.devmin));
+               input_report_abs(input, ABS_Y, int2bound(&c->y, c->y.devmax - y));
+       }
+
+       input_report_abs(input, ABS_PRESSURE, int2bound(&c->p, p));
+
+       input_report_key(input, BTN_TOOL_FINGER, n == 1);
+       input_report_key(input, BTN_TOOL_DOUBLETAP, n == 2);
+       input_report_key(input, BTN_TOOL_TRIPLETAP, n > 2);
+
+       input_sync(input);
+
+       return 0;
+}
+
+/* Wellspring initialization constants */
+#define BCM5974_WELLSPRING_MODE_READ_REQUEST_ID                1
+#define BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID       9
+#define BCM5974_WELLSPRING_MODE_REQUEST_VALUE          0x300
+#define BCM5974_WELLSPRING_MODE_REQUEST_INDEX          0
+#define BCM5974_WELLSPRING_MODE_VENDOR_VALUE           0x01
+
+static int bcm5974_wellspring_mode(struct bcm5974 *dev)
+{
+       char *data = kmalloc(8, GFP_KERNEL);
+       int retval = 0, size;
+
+       if (!data) {
+               err("bcm5974: out of memory");
+               retval = -ENOMEM;
+               goto out;
+       }
+
+       /* read configuration */
+       size = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0),
+                       BCM5974_WELLSPRING_MODE_READ_REQUEST_ID,
+                       USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
+                       BCM5974_WELLSPRING_MODE_REQUEST_VALUE,
+                       BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000);
+
+       if (size != 8) {
+               err("bcm5974: could not read from device");
+               retval = -EIO;
+               goto out;
+       }
+
+       /* apply the mode switch */
+       data[0] = BCM5974_WELLSPRING_MODE_VENDOR_VALUE;
+
+       /* write configuration */
+       size = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0),
+                       BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID,
+                       USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
+                       BCM5974_WELLSPRING_MODE_REQUEST_VALUE,
+                       BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000);
+
+       if (size != 8) {
+               err("bcm5974: could not write to device");
+               retval = -EIO;
+               goto out;
+       }
+
+       dprintk(2, "bcm5974: switched to wellspring mode.\n");
+
+ out:
+       kfree(data);
+       return retval;
+}
+
+static void bcm5974_irq_button(struct urb *urb)
+{
+       struct bcm5974 *dev = urb->context;
+       int error;
+
+       switch (urb->status) {
+       case 0:
+               break;
+       case -EOVERFLOW:
+       case -ECONNRESET:
+       case -ENOENT:
+       case -ESHUTDOWN:
+               dbg("bcm5974: button urb shutting down: %d", urb->status);
+               return;
+       default:
+               dbg("bcm5974: button urb status: %d", urb->status);
+               goto exit;
+       }
+
+       if (report_bt_state(dev, dev->bt_urb->actual_length))
+               dprintk(1, "bcm5974: bad button package, length: %d\n",
+                       dev->bt_urb->actual_length);
+
+exit:
+       error = usb_submit_urb(dev->bt_urb, GFP_ATOMIC);
+       if (error)
+               err("bcm5974: button urb failed: %d", error);
+}
+
+static void bcm5974_irq_trackpad(struct urb *urb)
+{
+       struct bcm5974 *dev = urb->context;
+       int error;
+
+       switch (urb->status) {
+       case 0:
+               break;
+       case -EOVERFLOW:
+       case -ECONNRESET:
+       case -ENOENT:
+       case -ESHUTDOWN:
+               dbg("bcm5974: trackpad urb shutting down: %d", urb->status);
+               return;
+       default:
+               dbg("bcm5974: trackpad urb status: %d", urb->status);
+               goto exit;
+       }
+
+       /* control response ignored */
+       if (dev->tp_urb->actual_length == 2)
+               goto exit;
+
+       if (report_tp_state(dev, dev->tp_urb->actual_length))
+               dprintk(1, "bcm5974: bad trackpad package, length: %d\n",
+                       dev->tp_urb->actual_length);
+
+exit:
+       error = usb_submit_urb(dev->tp_urb, GFP_ATOMIC);
+       if (error)
+               err("bcm5974: trackpad urb failed: %d", error);
+}
+
+/*
+ * The Wellspring trackpad, like many recent Apple trackpads, share
+ * the usb device with the keyboard. Since keyboards are usually
+ * handled by the HID system, the device ends up being handled by two
+ * modules. Setting up the device therefore becomes slightly
+ * complicated. To enable multitouch features, a mode switch is
+ * required, which is usually applied via the control interface of the
+ * device.  It can be argued where this switch should take place. In
+ * some drivers, like appletouch, the switch is made during
+ * probe. However, the hid module may also alter the state of the
+ * device, resulting in trackpad malfunction under certain
+ * circumstances. To get around this problem, there is at least one
+ * example that utilizes the USB_QUIRK_RESET_RESUME quirk in order to
+ * recieve a reset_resume request rather than the normal resume.
+ * Since the implementation of reset_resume is equal to mode switch
+ * plus start_traffic, it seems easier to always do the switch when
+ * starting traffic on the device.
+ */
+static int bcm5974_start_traffic(struct bcm5974 *dev)
+{
+       if (bcm5974_wellspring_mode(dev)) {
+               dprintk(1, "bcm5974: mode switch failed\n");
+               goto error;
+       }
+
+       if (usb_submit_urb(dev->bt_urb, GFP_KERNEL))
+               goto error;
+
+       if (usb_submit_urb(dev->tp_urb, GFP_KERNEL))
+               goto err_kill_bt;
+
+       return 0;
+
+err_kill_bt:
+       usb_kill_urb(dev->bt_urb);
+error:
+       return -EIO;
+}
+
+static void bcm5974_pause_traffic(struct bcm5974 *dev)
+{
+       usb_kill_urb(dev->tp_urb);
+       usb_kill_urb(dev->bt_urb);
+}
+
+/*
+ * The code below implements open/close and manual suspend/resume.
+ * All functions may be called in random order.
+ *
+ * Opening a suspended device fails with EACCES - permission denied.
+ *
+ * Failing a resume leaves the device resumed but closed.
+ */
+static int bcm5974_open(struct input_dev *input)
+{
+       struct bcm5974 *dev = input_get_drvdata(input);
+       int error;
+
+       error = usb_autopm_get_interface(dev->intf);
+       if (error)
+               return error;
+
+       mutex_lock(&dev->pm_mutex);
+
+       error = bcm5974_start_traffic(dev);
+       if (!error)
+               dev->opened = 1;
+
+       mutex_unlock(&dev->pm_mutex);
+
+       if (error)
+               usb_autopm_put_interface(dev->intf);
+
+       return error;
+}
+
+static void bcm5974_close(struct input_dev *input)
+{
+       struct bcm5974 *dev = input_get_drvdata(input);
+
+       mutex_lock(&dev->pm_mutex);
+
+       bcm5974_pause_traffic(dev);
+       dev->opened = 0;
+
+       mutex_unlock(&dev->pm_mutex);
+
+       usb_autopm_put_interface(dev->intf);
+}
+
+static int bcm5974_suspend(struct usb_interface *iface, pm_message_t message)
+{
+       struct bcm5974 *dev = usb_get_intfdata(iface);
+
+       mutex_lock(&dev->pm_mutex);
+
+       if (dev->opened)
+               bcm5974_pause_traffic(dev);
+
+       mutex_unlock(&dev->pm_mutex);
+
+       return 0;
+}
+
+static int bcm5974_resume(struct usb_interface *iface)
+{
+       struct bcm5974 *dev = usb_get_intfdata(iface);
+       int error = 0;
+
+       mutex_lock(&dev->pm_mutex);
+
+       if (dev->opened)
+               error = bcm5974_start_traffic(dev);
+
+       mutex_unlock(&dev->pm_mutex);
+
+       return error;
+}
+
+static int bcm5974_probe(struct usb_interface *iface,
+                        const struct usb_device_id *id)
+{
+       struct usb_device *udev = interface_to_usbdev(iface);
+       const struct bcm5974_config *cfg;
+       struct bcm5974 *dev;
+       struct input_dev *input_dev;
+       int error = -ENOMEM;
+
+       /* find the product index */
+       cfg = bcm5974_get_config(udev);
+
+       /* allocate memory for our device state and initialize it */
+       dev = kzalloc(sizeof(struct bcm5974), GFP_KERNEL);
+       input_dev = input_allocate_device();
+       if (!dev || !input_dev) {
+               err("bcm5974: out of memory");
+               goto err_free_devs;
+       }
+
+       dev->udev = udev;
+       dev->intf = iface;
+       dev->input = input_dev;
+       dev->cfg = *cfg;
+       mutex_init(&dev->pm_mutex);
+
+       /* setup urbs */
+       dev->bt_urb = usb_alloc_urb(0, GFP_KERNEL);
+       if (!dev->bt_urb)
+               goto err_free_devs;
+
+       dev->tp_urb = usb_alloc_urb(0, GFP_KERNEL);
+       if (!dev->tp_urb)
+               goto err_free_bt_urb;
+
+       dev->bt_data = usb_buffer_alloc(dev->udev,
+                                       dev->cfg.bt_datalen, GFP_KERNEL,
+                                       &dev->bt_urb->transfer_dma);
+       if (!dev->bt_data)
+               goto err_free_urb;
+
+       dev->tp_data = usb_buffer_alloc(dev->udev,
+                                       dev->cfg.tp_datalen, GFP_KERNEL,
+                                       &dev->tp_urb->transfer_dma);
+       if (!dev->tp_data)
+               goto err_free_bt_buffer;
+
+       usb_fill_int_urb(dev->bt_urb, udev,
+                        usb_rcvintpipe(udev, cfg->bt_ep),
+                        dev->bt_data, dev->cfg.bt_datalen,
+                        bcm5974_irq_button, dev, 1);
+
+       usb_fill_int_urb(dev->tp_urb, udev,
+                        usb_rcvintpipe(udev, cfg->tp_ep),
+                        dev->tp_data, dev->cfg.tp_datalen,
+                        bcm5974_irq_trackpad, dev, 1);
+
+       /* create bcm5974 device */
+       usb_make_path(udev, dev->phys, sizeof(dev->phys));
+       strlcat(dev->phys, "/input0", sizeof(dev->phys));
+
+       input_dev->name = "bcm5974";
+       input_dev->phys = dev->phys;
+       usb_to_input_id(dev->udev, &input_dev->id);
+       input_dev->dev.parent = &iface->dev;
+
+       input_set_drvdata(input_dev, dev);
+
+       input_dev->open = bcm5974_open;
+       input_dev->close = bcm5974_close;
+
+       setup_events_to_report(input_dev, cfg);
+
+       error = input_register_device(dev->input);
+       if (error)
+               goto err_free_buffer;
+
+       /* save our data pointer in this interface device */
+       usb_set_intfdata(iface, dev);
+
+       return 0;
+
+err_free_buffer:
+       usb_buffer_free(dev->udev, dev->cfg.tp_datalen,
+               dev->tp_data, dev->tp_urb->transfer_dma);
+err_free_bt_buffer:
+       usb_buffer_free(dev->udev, dev->cfg.bt_datalen,
+               dev->bt_data, dev->bt_urb->transfer_dma);
+err_free_urb:
+       usb_free_urb(dev->tp_urb);
+err_free_bt_urb:
+       usb_free_urb(dev->bt_urb);
+err_free_devs:
+       usb_set_intfdata(iface, NULL);
+       input_free_device(input_dev);
+       kfree(dev);
+       return error;
+}
+
+static void bcm5974_disconnect(struct usb_interface *iface)
+{
+       struct bcm5974 *dev = usb_get_intfdata(iface);
+
+       usb_set_intfdata(iface, NULL);
+
+       input_unregister_device(dev->input);
+       usb_buffer_free(dev->udev, dev->cfg.tp_datalen,
+                       dev->tp_data, dev->tp_urb->transfer_dma);
+       usb_buffer_free(dev->udev, dev->cfg.bt_datalen,
+                       dev->bt_data, dev->bt_urb->transfer_dma);
+       usb_free_urb(dev->tp_urb);
+       usb_free_urb(dev->bt_urb);
+       kfree(dev);
+}
+
+static struct usb_driver bcm5974_driver = {
+       .name                   = "bcm5974",
+       .probe                  = bcm5974_probe,
+       .disconnect             = bcm5974_disconnect,
+       .suspend                = bcm5974_suspend,
+       .resume                 = bcm5974_resume,
+       .reset_resume           = bcm5974_resume,
+       .id_table               = bcm5974_table,
+       .supports_autosuspend   = 1,
+};
+
+static int __init bcm5974_init(void)
+{
+       return usb_register(&bcm5974_driver);
+}
+
+static void __exit bcm5974_exit(void)
+{
+       usb_deregister(&bcm5974_driver);
+}
+
+module_init(bcm5974_init);
+module_exit(bcm5974_exit);
+
index fe732a5..3282b74 100644 (file)
@@ -394,6 +394,13 @@ static struct dmi_system_id __initdata i8042_dmi_dritek_table[] = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
                },
        },
+       {
+               .ident = "Acer TravelMate 4280",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
+               },
+       },
        { }
 };
 
index 0ed044d..7650078 100644 (file)
@@ -269,8 +269,8 @@ static int xps2_setup(struct device *dev, struct resource *regs_res,
         * we have the PS2 in a good state */
        out_be32(drvdata->base_address + XPS2_SRST_OFFSET, XPS2_SRST_RESET);
 
-       dev_info(dev, "Xilinx PS2 at 0x%08X mapped to 0x%08X, irq=%d\n",
-               drvdata->phys_addr, (u32)drvdata->base_address, drvdata->irq);
+       dev_info(dev, "Xilinx PS2 at 0x%08X mapped to 0x%p, irq=%d\n",
+               drvdata->phys_addr, drvdata->base_address, drvdata->irq);
 
        serio = &drvdata->serio;
        serio->id.type = SERIO_8042;
index 6e60a97..25287e8 100644 (file)
@@ -249,29 +249,26 @@ config TOUCHSCREEN_WM97XX
 config TOUCHSCREEN_WM9705
        bool "WM9705 Touchscreen interface support"
        depends on TOUCHSCREEN_WM97XX
+       default y
        help
-         Say Y here if you have a Wolfson Microelectronics WM9705
-         touchscreen controller connected to your system.
-
-         If unsure, say N.
+         Say Y here to enable support for the Wolfson Microelectronics
+         WM9705 touchscreen controller.
 
 config TOUCHSCREEN_WM9712
        bool "WM9712 Touchscreen interface support"
        depends on TOUCHSCREEN_WM97XX
+       default y
        help
-         Say Y here if you have a Wolfson Microelectronics WM9712
-         touchscreen controller connected to your system.
-
-         If unsure, say N.
+         Say Y here to enable support for the Wolfson Microelectronics
+         WM9712 touchscreen controller.
 
 config TOUCHSCREEN_WM9713
        bool "WM9713 Touchscreen interface support"
        depends on TOUCHSCREEN_WM97XX
+       default y
        help
-         Say Y here if you have a Wolfson Microelectronics WM9713 touchscreen
-         controller connected to your system.
-
-         If unsure, say N.
+         Say Y here to enable support for the Wolfson Microelectronics
+         WM9713 touchscreen controller.
 
 config TOUCHSCREEN_WM97XX_MAINSTONE
        tristate "WM97xx Mainstone accelerated touch"
index c7aae66..8cfadc5 100644 (file)
@@ -2393,6 +2393,8 @@ static void analyze_sbs(mddev_t * mddev)
 
 }
 
+static void md_safemode_timeout(unsigned long data);
+
 static ssize_t
 safe_delay_show(mddev_t *mddev, char *page)
 {
@@ -2432,9 +2434,12 @@ safe_delay_store(mddev_t *mddev, const char *cbuf, size_t len)
        if (msec == 0)
                mddev->safemode_delay = 0;
        else {
+               unsigned long old_delay = mddev->safemode_delay;
                mddev->safemode_delay = (msec*HZ)/1000;
                if (mddev->safemode_delay == 0)
                        mddev->safemode_delay = 1;
+               if (mddev->safemode_delay < old_delay)
+                       md_safemode_timeout((unsigned long)mddev);
        }
        return len;
 }
@@ -4634,6 +4639,11 @@ static int update_size(mddev_t *mddev, sector_t num_sectors)
         */
        if (mddev->sync_thread)
                return -EBUSY;
+       if (mddev->bitmap)
+               /* Sorry, cannot grow a bitmap yet, just remove it,
+                * grow, and re-add.
+                */
+               return -EBUSY;
        rdev_for_each(rdev, tmp, mddev) {
                sector_t avail;
                avail = rdev->size * 2;
@@ -5993,7 +6003,7 @@ static int remove_and_add_spares(mddev_t *mddev)
                        }
                }
 
-       if (mddev->degraded) {
+       if (mddev->degraded && ! mddev->ro) {
                rdev_for_each(rdev, rtmp, mddev) {
                        if (rdev->raid_disk >= 0 &&
                            !test_bit(In_sync, &rdev->flags) &&
@@ -6067,6 +6077,8 @@ void md_check_recovery(mddev_t *mddev)
                flush_signals(current);
        }
 
+       if (mddev->ro && !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery))
+               return;
        if ( ! (
                (mddev->flags && !mddev->external) ||
                test_bit(MD_RECOVERY_NEEDED, &mddev->recovery) ||
@@ -6080,6 +6092,15 @@ void md_check_recovery(mddev_t *mddev)
        if (mddev_trylock(mddev)) {
                int spares = 0;
 
+               if (mddev->ro) {
+                       /* Only thing we do on a ro array is remove
+                        * failed devices.
+                        */
+                       remove_and_add_spares(mddev);
+                       clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
+                       goto unlock;
+               }
+
                if (!mddev->external) {
                        int did_change = 0;
                        spin_lock_irq(&mddev->write_lock);
@@ -6117,7 +6138,8 @@ void md_check_recovery(mddev_t *mddev)
                        /* resync has finished, collect result */
                        md_unregister_thread(mddev->sync_thread);
                        mddev->sync_thread = NULL;
-                       if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
+                       if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery) &&
+                           !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) {
                                /* success...*/
                                /* activate any spares */
                                if (mddev->pers->spare_active(mddev))
@@ -6169,6 +6191,7 @@ void md_check_recovery(mddev_t *mddev)
                } else if ((spares = remove_and_add_spares(mddev))) {
                        clear_bit(MD_RECOVERY_SYNC, &mddev->recovery);
                        clear_bit(MD_RECOVERY_CHECK, &mddev->recovery);
+                       clear_bit(MD_RECOVERY_REQUESTED, &mddev->recovery);
                        set_bit(MD_RECOVERY_RECOVER, &mddev->recovery);
                } else if (mddev->recovery_cp < MaxSector) {
                        set_bit(MD_RECOVERY_SYNC, &mddev->recovery);
@@ -6232,7 +6255,11 @@ static int md_notify_reboot(struct notifier_block *this,
 
                for_each_mddev(mddev, tmp)
                        if (mddev_trylock(mddev)) {
-                               do_md_stop (mddev, 1, 0);
+                               /* Force a switch to readonly even array
+                                * appears to still be in use.  Hence
+                                * the '100'.
+                                */
+                               do_md_stop (mddev, 1, 100);
                                mddev_unlock(mddev);
                        }
                /*
index d41bebb..e34cd0e 100644 (file)
@@ -76,11 +76,13 @@ static void r10bio_pool_free(void *r10_bio, void *data)
        kfree(r10_bio);
 }
 
+/* Maximum size of each resync request */
 #define RESYNC_BLOCK_SIZE (64*1024)
-//#define RESYNC_BLOCK_SIZE PAGE_SIZE
-#define RESYNC_SECTORS (RESYNC_BLOCK_SIZE >> 9)
 #define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE)
-#define RESYNC_WINDOW (2048*1024)
+/* amount of memory to reserve for resync requests */
+#define RESYNC_WINDOW (1024*1024)
+/* maximum number of concurrent requests, memory permitting */
+#define RESYNC_DEPTH (32*1024*1024/RESYNC_BLOCK_SIZE)
 
 /*
  * When performing a resync, we need to read and compare, so
@@ -690,7 +692,6 @@ static int flush_pending_writes(conf_t *conf)
  *    there is no normal IO happeing.  It must arrange to call
  *    lower_barrier when the particular background IO completes.
  */
-#define RESYNC_DEPTH 32
 
 static void raise_barrier(conf_t *conf, int force)
 {
index 40e9396..224de02 100644 (file)
@@ -2568,10 +2568,10 @@ static bool handle_stripe5(struct stripe_head *sh)
                if (dev->written)
                        s.written++;
                rdev = rcu_dereference(conf->disks[i].rdev);
-               if (rdev && unlikely(test_bit(Blocked, &rdev->flags))) {
+               if (blocked_rdev == NULL &&
+                   rdev && unlikely(test_bit(Blocked, &rdev->flags))) {
                        blocked_rdev = rdev;
                        atomic_inc(&rdev->nr_pending);
-                       break;
                }
                if (!rdev || !test_bit(In_sync, &rdev->flags)) {
                        /* The ReadError flag will just be confusing now */
@@ -2588,8 +2588,14 @@ static bool handle_stripe5(struct stripe_head *sh)
        rcu_read_unlock();
 
        if (unlikely(blocked_rdev)) {
-               set_bit(STRIPE_HANDLE, &sh->state);
-               goto unlock;
+               if (s.syncing || s.expanding || s.expanded ||
+                   s.to_write || s.written) {
+                       set_bit(STRIPE_HANDLE, &sh->state);
+                       goto unlock;
+               }
+               /* There is nothing for the blocked_rdev to block */
+               rdev_dec_pending(blocked_rdev, conf->mddev);
+               blocked_rdev = NULL;
        }
 
        if (s.to_fill && !test_bit(STRIPE_BIOFILL_RUN, &sh->state)) {
@@ -2832,10 +2838,10 @@ static bool handle_stripe6(struct stripe_head *sh, struct page *tmp_page)
                if (dev->written)
                        s.written++;
                rdev = rcu_dereference(conf->disks[i].rdev);
-               if (rdev && unlikely(test_bit(Blocked, &rdev->flags))) {
+               if (blocked_rdev == NULL &&
+                   rdev && unlikely(test_bit(Blocked, &rdev->flags))) {
                        blocked_rdev = rdev;
                        atomic_inc(&rdev->nr_pending);
-                       break;
                }
                if (!rdev || !test_bit(In_sync, &rdev->flags)) {
                        /* The ReadError flag will just be confusing now */
@@ -2853,9 +2859,16 @@ static bool handle_stripe6(struct stripe_head *sh, struct page *tmp_page)
        rcu_read_unlock();
 
        if (unlikely(blocked_rdev)) {
-               set_bit(STRIPE_HANDLE, &sh->state);
-               goto unlock;
+               if (s.syncing || s.expanding || s.expanded ||
+                   s.to_write || s.written) {
+                       set_bit(STRIPE_HANDLE, &sh->state);
+                       goto unlock;
+               }
+               /* There is nothing for the blocked_rdev to block */
+               rdev_dec_pending(blocked_rdev, conf->mddev);
+               blocked_rdev = NULL;
        }
+
        pr_debug("locked=%d uptodate=%d to_read=%d"
               " to_write=%d failed=%d failed_num=%d,%d\n",
               s.locked, s.uptodate, s.to_read, s.to_write, s.failed,
@@ -4446,6 +4459,9 @@ static int raid5_check_reshape(mddev_t *mddev)
                return -EINVAL; /* Cannot shrink array or change level yet */
        if (mddev->delta_disks == 0)
                return 0; /* nothing to do */
+       if (mddev->bitmap)
+               /* Cannot grow a bitmap yet */
+               return -EBUSY;
 
        /* Can only proceed if there are plenty of stripe_heads.
         * We need a minimum of one full stripe,, and for sensible progress
index e7a3fe5..b2d9878 100644 (file)
@@ -803,11 +803,30 @@ static acpi_status get_u32(u32 *value, u32 cap)
 
 static acpi_status set_u32(u32 value, u32 cap)
 {
+       acpi_status status;
+
        if (interface->capability & cap) {
                switch (interface->type) {
                case ACER_AMW0:
                        return AMW0_set_u32(value, cap, interface);
                case ACER_AMW0_V2:
+                       if (cap == ACER_CAP_MAILLED)
+                               return AMW0_set_u32(value, cap, interface);
+
+                       /*
+                        * On some models, some WMID methods don't toggle
+                        * properly. For those cases, we want to run the AMW0
+                        * method afterwards to be certain we've really toggled
+                        * the device state.
+                        */
+                       if (cap == ACER_CAP_WIRELESS ||
+                               cap == ACER_CAP_BLUETOOTH) {
+                               status = WMID_set_u32(value, cap, interface);
+                               if (ACPI_FAILURE(status))
+                                       return status;
+
+                               return AMW0_set_u32(value, cap, interface);
+                       }
                case ACER_WMID:
                        return WMID_set_u32(value, cap, interface);
                default:
index 6400248..917cf8d 100644 (file)
@@ -19,7 +19,7 @@
 #include <asm/io.h>
 #include <asm/sizes.h>
 #include <mach/hardware.h>
-#include <asm/plat-orion/orion_nand.h>
+#include <plat/orion_nand.h>
 
 #ifdef CONFIG_MTD_CMDLINE_PARTS
 static const char *part_probes[] = { "cmdlinepart", NULL };
index a8771ff..e07b5c5 100644 (file)
 
 static int palmtx_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
-       skt->irq = IRQ_GPIO(GPIO_NR_PALMTX_PCMCIA_READY);
+       int ret;
+
+       ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_POWER1, "PCMCIA PWR1");
+       if (ret)
+               goto err1;
+       ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_POWER1, 0);
+       if (ret)
+               goto err2;
+
+       ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_POWER2, "PCMCIA PWR2");
+       if (ret)
+               goto err2;
+       ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_POWER2, 0);
+       if (ret)
+               goto err3;
+
+       ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_RESET, "PCMCIA RST");
+       if (ret)
+               goto err3;
+       ret = gpio_direction_output(GPIO_NR_PALMTX_PCMCIA_RESET, 1);
+       if (ret)
+               goto err4;
+
+       ret = gpio_request(GPIO_NR_PALMTX_PCMCIA_READY, "PCMCIA RDY");
+       if (ret)
+               goto err4;
+       ret = gpio_direction_input(GPIO_NR_PALMTX_PCMCIA_READY);
+       if (ret)
+               goto err5;
+
+       skt->irq = gpio_to_irq(GPIO_NR_PALMTX_PCMCIA_READY);
        return 0;
+
+err5:
+       gpio_free(GPIO_NR_PALMTX_PCMCIA_READY);
+err4:
+       gpio_free(GPIO_NR_PALMTX_PCMCIA_RESET);
+err3:
+       gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER2);
+err2:
+       gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER1);
+err1:
+       return ret;
 }
 
 static void palmtx_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
 {
+       gpio_free(GPIO_NR_PALMTX_PCMCIA_READY);
+       gpio_free(GPIO_NR_PALMTX_PCMCIA_RESET);
+       gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER2);
+       gpio_free(GPIO_NR_PALMTX_PCMCIA_POWER1);
 }
 
 static void palmtx_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
@@ -109,7 +154,7 @@ static void __exit palmtx_pcmcia_exit(void)
        platform_device_unregister(palmtx_pcmcia_device);
 }
 
-fs_initcall(palmtx_pcmcia_init);
+module_init(palmtx_pcmcia_init);
 module_exit(palmtx_pcmcia_exit);
 
 MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
index 3b4a14e..77cb342 100644 (file)
@@ -449,6 +449,7 @@ config SERIAL_CLPS711X_CONSOLE
 config SERIAL_SAMSUNG
        tristate "Samsung SoC serial support"
        depends on ARM && PLAT_S3C24XX
+       select SERIAL_CORE
        help
          Support for the on-chip UARTs on the Samsung S3C24XX series CPUs,
          providing /dev/ttySAC0, 1 and 2 (note, some machines may not
index 964124b..75e8686 100644 (file)
@@ -226,10 +226,11 @@ EXPORT_SYMBOL_GPL(spi_alloc_device);
  * Companion function to spi_alloc_device.  Devices allocated with
  * spi_alloc_device can be added onto the spi bus with this function.
  *
- * Returns 0 on success; non-zero on failure
+ * Returns 0 on success; negative errno on failure
  */
 int spi_add_device(struct spi_device *spi)
 {
+       static DEFINE_MUTEX(spi_add_lock);
        struct device *dev = spi->master->dev.parent;
        int status;
 
@@ -246,26 +247,43 @@ int spi_add_device(struct spi_device *spi)
                        "%s.%u", spi->master->dev.bus_id,
                        spi->chip_select);
 
-       /* drivers may modify this initial i/o setup */
+
+       /* We need to make sure there's no other device with this
+        * chipselect **BEFORE** we call setup(), else we'll trash
+        * its configuration.  Lock against concurrent add() calls.
+        */
+       mutex_lock(&spi_add_lock);
+
+       if (bus_find_device_by_name(&spi_bus_type, NULL, spi->dev.bus_id)
+                       != NULL) {
+               dev_err(dev, "chipselect %d already in use\n",
+                               spi->chip_select);
+               status = -EBUSY;
+               goto done;
+       }
+
+       /* Drivers may modify this initial i/o setup, but will
+        * normally rely on the device being setup.  Devices
+        * using SPI_CS_HIGH can't coexist well otherwise...
+        */
        status = spi->master->setup(spi);
        if (status < 0) {
                dev_err(dev, "can't %s %s, status %d\n",
                                "setup", spi->dev.bus_id, status);
-               return status;
+               goto done;
        }
 
-       /* driver core catches callers that misbehave by defining
-        * devices that already exist.
-        */
+       /* Device may be bound to an active driver when this returns */
        status = device_add(&spi->dev);
-       if (status < 0) {
+       if (status < 0)
                dev_err(dev, "can't %s %s, status %d\n",
                                "add", spi->dev.bus_id, status);
-               return status;
-       }
+       else
+               dev_dbg(dev, "registered child %s\n", spi->dev.bus_id);
 
-       dev_dbg(dev, "registered child %s\n", spi->dev.bus_id);
-       return 0;
+done:
+       mutex_unlock(&spi_add_lock);
+       return status;
 }
 EXPORT_SYMBOL_GPL(spi_add_device);
 
index 5fbdc14..5416cf9 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/mbus.h>
-#include <asm/plat-orion/ehci-orion.h>
+#include <plat/ehci-orion.h>
 
 #define rdl(off)       __raw_readl(hcd->regs + (off))
 #define wrl(off, val)  __raw_writel((val), hcd->regs + (off))
index bd320a2..fb51197 100644 (file)
@@ -479,6 +479,10 @@ static void adjust_aoi_size_position(struct fb_var_screeninfo *var,
        base_plane_width = machine_data->fsl_diu_info[0]->var.xres;
        base_plane_height = machine_data->fsl_diu_info[0]->var.yres;
 
+       if (mfbi->x_aoi_d < 0)
+               mfbi->x_aoi_d = 0;
+       if (mfbi->y_aoi_d < 0)
+               mfbi->y_aoi_d = 0;
        switch (index) {
        case 0:
                if (mfbi->x_aoi_d != 0)
@@ -777,6 +781,22 @@ static void unmap_video_memory(struct fb_info *info)
        info->fix.smem_len = 0;
 }
 
+/*
+ * Using the fb_var_screeninfo in fb_info we set the aoi of this
+ * particular framebuffer. It is a light version of fsl_diu_set_par.
+ */
+static int fsl_diu_set_aoi(struct fb_info *info)
+{
+       struct fb_var_screeninfo *var = &info->var;
+       struct mfb_info *mfbi = info->par;
+       struct diu_ad *ad = mfbi->ad;
+
+       /* AOI should not be greater than display size */
+       ad->offset_xyi = cpu_to_le32((var->yoffset << 16) | var->xoffset);
+       ad->offset_xyd = cpu_to_le32((mfbi->y_aoi_d << 16) | mfbi->x_aoi_d);
+       return 0;
+}
+
 /*
  * Using the fb_var_screeninfo in fb_info we set the resolution of this
  * particular framebuffer. This function alters the fb_fix_screeninfo stored
@@ -817,11 +837,11 @@ static int fsl_diu_set_par(struct fb_info *info)
                diu_ops.get_pixel_format(var->bits_per_pixel,
                                         machine_data->monitor_port);
        ad->addr    = cpu_to_le32(info->fix.smem_start);
-       ad->src_size_g_alpha = cpu_to_le32((var->yres << 12) |
-                               var->xres) | mfbi->g_alpha;
-       /* fix me. AOI should not be greater than display size */
+       ad->src_size_g_alpha = cpu_to_le32((var->yres_virtual << 12) |
+                               var->xres_virtual) | mfbi->g_alpha;
+       /* AOI should not be greater than display size */
        ad->aoi_size    = cpu_to_le32((var->yres << 16) | var->xres);
-       ad->offset_xyi = 0;
+       ad->offset_xyi = cpu_to_le32((var->yoffset << 16) | var->xoffset);
        ad->offset_xyd = cpu_to_le32((mfbi->y_aoi_d << 16) | mfbi->x_aoi_d);
 
        /* Disable chroma keying function */
@@ -921,6 +941,8 @@ static int fsl_diu_pan_display(struct fb_var_screeninfo *var,
        else
                info->var.vmode &= ~FB_VMODE_YWRAP;
 
+       fsl_diu_set_aoi(info);
+
        return 0;
 }
 
@@ -989,7 +1011,7 @@ static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,
                pr_debug("set AOI display offset of index %d to (%d,%d)\n",
                                 mfbi->index, aoi_d.x_aoi_d, aoi_d.y_aoi_d);
                fsl_diu_check_var(&info->var, info);
-               fsl_diu_set_par(info);
+               fsl_diu_set_aoi(info);
                break;
        case MFB_GET_AOID:
                aoi_d.x_aoi_d = mfbi->x_aoi_d;
index e7aa7ae..9720449 100644 (file)
@@ -1031,7 +1031,9 @@ static void pxafb_setup_gpio(struct pxafb_info *fbi)
        pxa_gpio_mode(GPIO74_LCD_FCLK_MD);
        pxa_gpio_mode(GPIO75_LCD_LCLK_MD);
        pxa_gpio_mode(GPIO76_LCD_PCLK_MD);
-       pxa_gpio_mode(GPIO77_LCD_ACBIAS_MD);
+
+       if ((lccr0 & LCCR0_PAS) == 0)
+               pxa_gpio_mode(GPIO77_LCD_ACBIAS_MD);
 }
 
 static void pxafb_enable_controller(struct pxafb_info *fbi)
@@ -1400,6 +1402,8 @@ static void pxafb_decode_mach_info(struct pxafb_info *fbi,
        if (lcd_conn == LCD_MONO_STN_8BPP)
                fbi->lccr0 |= LCCR0_DPD;
 
+       fbi->lccr0 |= (lcd_conn & LCD_ALTERNATE_MAPPING) ? LCCR0_LDDALT : 0;
+
        fbi->lccr3 = LCCR3_Acb((inf->lcd_conn >> 10) & 0xff);
        fbi->lccr3 |= (lcd_conn & LCD_BIAS_ACTIVE_LOW) ? LCCR3_OEP : 0;
        fbi->lccr3 |= (lcd_conn & LCD_PCLK_EDGE_FALL)  ? LCCR3_PCP : 0;
@@ -1673,53 +1677,63 @@ MODULE_PARM_DESC(options, "LCD parameters (see Documentation/fb/pxafb.txt)");
 #define pxafb_setup_options()          (0)
 #endif
 
-static int __devinit pxafb_probe(struct platform_device *dev)
-{
-       struct pxafb_info *fbi;
-       struct pxafb_mach_info *inf;
-       struct resource *r;
-       int irq, ret;
-
-       dev_dbg(&dev->dev, "pxafb_probe\n");
-
-       inf = dev->dev.platform_data;
-       ret = -ENOMEM;
-       fbi = NULL;
-       if (!inf)
-               goto failed;
-
-       ret = pxafb_parse_options(&dev->dev, g_options);
-       if (ret < 0)
-               goto failed;
-
 #ifdef DEBUG_VAR
-       /* Check for various illegal bit-combinations. Currently only
-        * a warning is given. */
+/* Check for various illegal bit-combinations. Currently only
+ * a warning is given. */
+static void __devinit pxafb_check_options(struct device *dev,
+                                         struct pxafb_mach_info *inf)
+{
+       if (inf->lcd_conn)
+               return;
 
        if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK)
-               dev_warn(&dev->dev, "machine LCCR0 setting contains "
+               dev_warn(dev, "machine LCCR0 setting contains "
                                "illegal bits: %08x\n",
                        inf->lccr0 & LCCR0_INVALID_CONFIG_MASK);
        if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK)
-               dev_warn(&dev->dev, "machine LCCR3 setting contains "
+               dev_warn(dev, "machine LCCR3 setting contains "
                                "illegal bits: %08x\n",
                        inf->lccr3 & LCCR3_INVALID_CONFIG_MASK);
        if (inf->lccr0 & LCCR0_DPD &&
            ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas ||
             (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl ||
             (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono))
-               dev_warn(&dev->dev, "Double Pixel Data (DPD) mode is "
+               dev_warn(dev, "Double Pixel Data (DPD) mode is "
                                "only valid in passive mono"
                                " single panel mode\n");
        if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act &&
            (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual)
-               dev_warn(&dev->dev, "Dual panel only valid in passive mode\n");
+               dev_warn(dev, "Dual panel only valid in passive mode\n");
        if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas &&
             (inf->modes->upper_margin || inf->modes->lower_margin))
-               dev_warn(&dev->dev, "Upper and lower margins must be 0 in "
+               dev_warn(dev, "Upper and lower margins must be 0 in "
                                "passive mode\n");
+}
+#else
+#define pxafb_check_options(...)       do {} while (0)
 #endif
 
+static int __devinit pxafb_probe(struct platform_device *dev)
+{
+       struct pxafb_info *fbi;
+       struct pxafb_mach_info *inf;
+       struct resource *r;
+       int irq, ret;
+
+       dev_dbg(&dev->dev, "pxafb_probe\n");
+
+       inf = dev->dev.platform_data;
+       ret = -ENOMEM;
+       fbi = NULL;
+       if (!inf)
+               goto failed;
+
+       ret = pxafb_parse_options(&dev->dev, g_options);
+       if (ret < 0)
+               goto failed;
+
+       pxafb_check_options(&dev->dev, inf);
+
        dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n",
                        inf->modes->xres,
                        inf->modes->yres,
index 3da2b90..22715e3 100644 (file)
@@ -157,8 +157,6 @@ static void s3c2410wdt_start(void)
        writel(wdt_count, wdt_base + S3C2410_WTCNT);
        writel(wtcon, wdt_base + S3C2410_WTCON);
        spin_unlock(&wdt_lock);
-
-       return 0;
 }
 
 static int s3c2410wdt_set_heartbeat(int timeout)
index e8da4ee..25ecbd5 100644 (file)
@@ -175,6 +175,8 @@ out_no_root:
        if (inode)
                iput(inode);
 
+       cifs_umount(sb, cifs_sb);
+
 out_mount_failed:
        if (cifs_sb) {
 #ifdef CONFIG_CIFS_DFS_UPCALL
index 28a2209..8482868 100644 (file)
@@ -649,6 +649,7 @@ struct inode *cifs_iget(struct super_block *sb, unsigned long ino)
                inode->i_fop = &simple_dir_operations;
                inode->i_uid = cifs_sb->mnt_uid;
                inode->i_gid = cifs_sb->mnt_gid;
+       } else if (rc) {
                _FreeXid(xid);
                iget_failed(inode);
                return ERR_PTR(rc);
index b6726f6..0487ddb 100644 (file)
@@ -166,6 +166,7 @@ static struct inode *alloc_inode(struct super_block *sb)
                mapping_set_gfp_mask(mapping, GFP_HIGHUSER_PAGECACHE);
                mapping->assoc_mapping = NULL;
                mapping->backing_dev_info = &default_backing_dev_info;
+               mapping->writeback_index = 0;
 
                /*
                 * If the block_device provides a backing_dev_info for client
index 697663b..e1c0ec0 100644 (file)
@@ -92,7 +92,7 @@ int omfs_allocate_block(struct super_block *sb, u64 block)
        struct buffer_head *bh;
        struct omfs_sb_info *sbi = OMFS_SB(sb);
        int bits_per_entry = 8 * sb->s_blocksize;
-       int map, bit;
+       unsigned int map, bit;
        int ret = 0;
        u64 tmp;
 
@@ -176,7 +176,8 @@ int omfs_clear_range(struct super_block *sb, u64 block, int count)
        struct omfs_sb_info *sbi = OMFS_SB(sb);
        int bits_per_entry = 8 * sb->s_blocksize;
        u64 tmp;
-       int map, bit, ret;
+       unsigned int map, bit;
+       int ret;
 
        tmp = block;
        bit = do_div(tmp, bits_per_entry);
index 7e24990..834b233 100644 (file)
@@ -26,6 +26,13 @@ static int omfs_sync_file(struct file *file, struct dentry *dentry,
        return err ? -EIO : 0;
 }
 
+static u32 omfs_max_extents(struct omfs_sb_info *sbi, int offset)
+{
+       return (sbi->s_sys_blocksize - offset -
+               sizeof(struct omfs_extent)) /
+               sizeof(struct omfs_extent_entry) + 1;
+}
+
 void omfs_make_empty_table(struct buffer_head *bh, int offset)
 {
        struct omfs_extent *oe = (struct omfs_extent *) &bh->b_data[offset];
@@ -45,6 +52,7 @@ int omfs_shrink_inode(struct inode *inode)
        struct buffer_head *bh;
        u64 next, last;
        u32 extent_count;
+       u32 max_extents;
        int ret;
 
        /* traverse extent table, freeing each entry that is greater
@@ -62,15 +70,18 @@ int omfs_shrink_inode(struct inode *inode)
                goto out;
 
        oe = (struct omfs_extent *)(&bh->b_data[OMFS_EXTENT_START]);
+       max_extents = omfs_max_extents(sbi, OMFS_EXTENT_START);
 
        for (;;) {
 
-               if (omfs_is_bad(sbi, (struct omfs_header *) bh->b_data, next)) {
-                       brelse(bh);
-                       goto out;
-               }
+               if (omfs_is_bad(sbi, (struct omfs_header *) bh->b_data, next))
+                       goto out_brelse;
 
                extent_count = be32_to_cpu(oe->e_extent_count);
+
+               if (extent_count > max_extents)
+                       goto out_brelse;
+
                last = next;
                next = be64_to_cpu(oe->e_next);
                entry = &oe->e_entry;
@@ -98,10 +109,14 @@ int omfs_shrink_inode(struct inode *inode)
                if (!bh)
                        goto out;
                oe = (struct omfs_extent *) (&bh->b_data[OMFS_EXTENT_CONT]);
+               max_extents = omfs_max_extents(sbi, OMFS_EXTENT_CONT);
        }
        ret = 0;
 out:
        return ret;
+out_brelse:
+       brelse(bh);
+       return ret;
 }
 
 static void omfs_truncate(struct inode *inode)
@@ -154,9 +169,7 @@ static int omfs_grow_extent(struct inode *inode, struct omfs_extent *oe,
                        goto out;
                }
        }
-       max_count = (sbi->s_sys_blocksize - OMFS_EXTENT_START -
-               sizeof(struct omfs_extent)) /
-               sizeof(struct omfs_extent_entry) + 1;
+       max_count = omfs_max_extents(sbi, OMFS_EXTENT_START);
 
        /* TODO: add a continuation block here */
        if (be32_to_cpu(oe->e_extent_count) > max_count-1)
@@ -225,6 +238,7 @@ static int omfs_get_block(struct inode *inode, sector_t block,
        sector_t next, offset;
        int ret;
        u64 new_block;
+       u32 max_extents;
        int extent_count;
        struct omfs_extent *oe;
        struct omfs_extent_entry *entry;
@@ -238,6 +252,7 @@ static int omfs_get_block(struct inode *inode, sector_t block,
                goto out;
 
        oe = (struct omfs_extent *)(&bh->b_data[OMFS_EXTENT_START]);
+       max_extents = omfs_max_extents(sbi, OMFS_EXTENT_START);
        next = inode->i_ino;
 
        for (;;) {
@@ -249,6 +264,9 @@ static int omfs_get_block(struct inode *inode, sector_t block,
                next = be64_to_cpu(oe->e_next);
                entry = &oe->e_entry;
 
+               if (extent_count > max_extents)
+                       goto out_brelse;
+
                offset = find_block(inode, entry, block, extent_count, &remain);
                if (offset > 0) {
                        ret = 0;
@@ -266,6 +284,7 @@ static int omfs_get_block(struct inode *inode, sector_t block,
                if (!bh)
                        goto out;
                oe = (struct omfs_extent *) (&bh->b_data[OMFS_EXTENT_CONT]);
+               max_extents = omfs_max_extents(sbi, OMFS_EXTENT_CONT);
        }
        if (create) {
                ret = omfs_grow_extent(inode, oe, &new_block);
index a95fe59..d29047b 100644 (file)
@@ -232,8 +232,7 @@ struct inode *omfs_iget(struct super_block *sb, ino_t ino)
                inode->i_mode = S_IFDIR | (S_IRWXUGO & ~sbi->s_dmask);
                inode->i_op = &omfs_dir_inops;
                inode->i_fop = &omfs_dir_operations;
-               inode->i_size = be32_to_cpu(oi->i_head.h_body_size) +
-                       sizeof(struct omfs_header);
+               inode->i_size = sbi->s_sys_blocksize;
                inc_nlink(inode);
                break;
        case OMFS_FILE:
index d81fb9e..1540981 100644 (file)
@@ -263,8 +263,8 @@ int ubifs_calc_min_idx_lebs(struct ubifs_info *c)
 
        idx_size = c->old_idx_sz + c->budg_idx_growth + c->budg_uncommitted_idx;
 
-       /* And make sure we have twice the index size of space reserved */
-       idx_size <<= 1;
+       /* And make sure we have thrice the index size of space reserved */
+       idx_size = idx_size + (idx_size << 1);
 
        /*
         * We do not maintain 'old_idx_size' as 'old_idx_lebs'/'old_idx_bytes'
@@ -388,11 +388,11 @@ static int can_use_rp(struct ubifs_info *c)
  * This function makes sure UBIFS has enough free eraseblocks for index growth
  * and data.
  *
- * When budgeting index space, UBIFS reserves twice as more LEBs as the index
+ * When budgeting index space, UBIFS reserves thrice as many LEBs as the index
  * would take if it was consolidated and written to the flash. This guarantees
  * that the "in-the-gaps" commit method always succeeds and UBIFS will always
  * be able to commit dirty index. So this function basically adds amount of
- * budgeted index space to the size of the current index, multiplies this by 2,
+ * budgeted index space to the size of the current index, multiplies this by 3,
  * and makes sure this does not exceed the amount of free eraseblocks.
  *
  * Notes about @c->min_idx_lebs and @c->lst.idx_lebs variables:
@@ -543,8 +543,16 @@ int ubifs_budget_space(struct ubifs_info *c, struct ubifs_budget_req *req)
        int err, idx_growth, data_growth, dd_growth;
        struct retries_info ri;
 
+       ubifs_assert(req->new_page <= 1);
+       ubifs_assert(req->dirtied_page <= 1);
+       ubifs_assert(req->new_dent <= 1);
+       ubifs_assert(req->mod_dent <= 1);
+       ubifs_assert(req->new_ino <= 1);
+       ubifs_assert(req->new_ino_d <= UBIFS_MAX_INO_DATA);
        ubifs_assert(req->dirtied_ino <= 4);
        ubifs_assert(req->dirtied_ino_d <= UBIFS_MAX_INO_DATA * 4);
+       ubifs_assert(!(req->new_ino_d & 7));
+       ubifs_assert(!(req->dirtied_ino_d & 7));
 
        data_growth = calc_data_growth(c, req);
        dd_growth = calc_dd_growth(c, req);
@@ -618,8 +626,16 @@ again:
  */
 void ubifs_release_budget(struct ubifs_info *c, struct ubifs_budget_req *req)
 {
+       ubifs_assert(req->new_page <= 1);
+       ubifs_assert(req->dirtied_page <= 1);
+       ubifs_assert(req->new_dent <= 1);
+       ubifs_assert(req->mod_dent <= 1);
+       ubifs_assert(req->new_ino <= 1);
+       ubifs_assert(req->new_ino_d <= UBIFS_MAX_INO_DATA);
        ubifs_assert(req->dirtied_ino <= 4);
        ubifs_assert(req->dirtied_ino_d <= UBIFS_MAX_INO_DATA * 4);
+       ubifs_assert(!(req->new_ino_d & 7));
+       ubifs_assert(!(req->dirtied_ino_d & 7));
        if (!req->recalculate) {
                ubifs_assert(req->idx_growth >= 0);
                ubifs_assert(req->data_growth >= 0);
@@ -647,7 +663,11 @@ void ubifs_release_budget(struct ubifs_info *c, struct ubifs_budget_req *req)
 
        ubifs_assert(c->budg_idx_growth >= 0);
        ubifs_assert(c->budg_data_growth >= 0);
+       ubifs_assert(c->budg_dd_growth >= 0);
        ubifs_assert(c->min_idx_lebs < c->main_lebs);
+       ubifs_assert(!(c->budg_idx_growth & 7));
+       ubifs_assert(!(c->budg_data_growth & 7));
+       ubifs_assert(!(c->budg_dd_growth & 7));
        spin_unlock(&c->space_lock);
 }
 
@@ -686,9 +706,10 @@ void ubifs_convert_page_budget(struct ubifs_info *c)
 void ubifs_release_dirty_inode_budget(struct ubifs_info *c,
                                      struct ubifs_inode *ui)
 {
-       struct ubifs_budget_req req = {.dd_growth = c->inode_budget,
-                                      .dirtied_ino_d = ui->data_len};
+       struct ubifs_budget_req req;
 
+       memset(&req, 0, sizeof(struct ubifs_budget_req));
+       req.dd_growth = c->inode_budget + ALIGN(ui->data_len, 8);
        ubifs_release_budget(c, &req);
 }
 
index 3b51631..0a6aa2c 100644 (file)
@@ -74,6 +74,7 @@ static int do_commit(struct ubifs_info *c)
                        goto out_up;
        }
 
+       c->cmt_no += 1;
        err = ubifs_gc_start_commit(c);
        if (err)
                goto out_up;
@@ -115,7 +116,7 @@ static int do_commit(struct ubifs_info *c)
                goto out;
 
        mutex_lock(&c->mst_mutex);
-       c->mst_node->cmt_no      = cpu_to_le64(++c->cmt_no);
+       c->mst_node->cmt_no      = cpu_to_le64(c->cmt_no);
        c->mst_node->log_lnum    = cpu_to_le32(new_ltail_lnum);
        c->mst_node->root_lnum   = cpu_to_le32(zroot.lnum);
        c->mst_node->root_offs   = cpu_to_le32(zroot.offs);
index 4e3aaeb..b9cb774 100644 (file)
@@ -568,8 +568,8 @@ void dbg_dump_budget_req(const struct ubifs_budget_req *req)
 void dbg_dump_lstats(const struct ubifs_lp_stats *lst)
 {
        spin_lock(&dbg_lock);
-       printk(KERN_DEBUG "Lprops statistics: empty_lebs %d, idx_lebs  %d\n",
-              lst->empty_lebs, lst->idx_lebs);
+       printk(KERN_DEBUG "(pid %d) Lprops statistics: empty_lebs %d, "
+              "idx_lebs  %d\n", current->pid, lst->empty_lebs, lst->idx_lebs);
        printk(KERN_DEBUG "\ttaken_empty_lebs %d, total_free %lld, "
               "total_dirty %lld\n", lst->taken_empty_lebs, lst->total_free,
               lst->total_dirty);
@@ -587,8 +587,8 @@ void dbg_dump_budg(struct ubifs_info *c)
        struct ubifs_gced_idx_leb *idx_gc;
 
        spin_lock(&dbg_lock);
-       printk(KERN_DEBUG "Budgeting info: budg_data_growth %lld, "
-              "budg_dd_growth %lld, budg_idx_growth %lld\n",
+       printk(KERN_DEBUG "(pid %d) Budgeting info: budg_data_growth %lld, "
+              "budg_dd_growth %lld, budg_idx_growth %lld\n", current->pid,
               c->budg_data_growth, c->budg_dd_growth, c->budg_idx_growth);
        printk(KERN_DEBUG "\tdata budget sum %lld, total budget sum %lld, "
               "freeable_cnt %d\n", c->budg_data_growth + c->budg_dd_growth,
@@ -634,7 +634,7 @@ void dbg_dump_lprops(struct ubifs_info *c)
        struct ubifs_lprops lp;
        struct ubifs_lp_stats lst;
 
-       printk(KERN_DEBUG "Dumping LEB properties\n");
+       printk(KERN_DEBUG "(pid %d) Dumping LEB properties\n", current->pid);
        ubifs_get_lp_stats(c, &lst);
        dbg_dump_lstats(&lst);
 
@@ -655,7 +655,7 @@ void dbg_dump_leb(const struct ubifs_info *c, int lnum)
        if (dbg_failure_mode)
                return;
 
-       printk(KERN_DEBUG "Dumping LEB %d\n", lnum);
+       printk(KERN_DEBUG "(pid %d) Dumping LEB %d\n", current->pid, lnum);
 
        sleb = ubifs_scan(c, lnum, 0, c->dbg_buf);
        if (IS_ERR(sleb)) {
@@ -720,8 +720,8 @@ void dbg_dump_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat)
 {
        int i;
 
-       printk(KERN_DEBUG "Dumping heap cat %d (%d elements)\n",
-              cat, heap->cnt);
+       printk(KERN_DEBUG "(pid %d) Dumping heap cat %d (%d elements)\n",
+              current->pid, cat, heap->cnt);
        for (i = 0; i < heap->cnt; i++) {
                struct ubifs_lprops *lprops = heap->arr[i];
 
@@ -736,7 +736,7 @@ void dbg_dump_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode,
 {
        int i;
 
-       printk(KERN_DEBUG "Dumping pnode:\n");
+       printk(KERN_DEBUG "(pid %d) Dumping pnode:\n", current->pid);
        printk(KERN_DEBUG "\taddress %zx parent %zx cnext %zx\n",
               (size_t)pnode, (size_t)parent, (size_t)pnode->cnext);
        printk(KERN_DEBUG "\tflags %lu iip %d level %d num %d\n",
@@ -755,7 +755,7 @@ void dbg_dump_tnc(struct ubifs_info *c)
        int level;
 
        printk(KERN_DEBUG "\n");
-       printk(KERN_DEBUG "Dumping the TNC tree\n");
+       printk(KERN_DEBUG "(pid %d) Dumping the TNC tree\n", current->pid);
        znode = ubifs_tnc_levelorder_next(c->zroot.znode, NULL);
        level = znode->level;
        printk(KERN_DEBUG "== Level %d ==\n", level);
@@ -2208,16 +2208,17 @@ int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset,
 int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf,
                  int offset, int len, int dtype)
 {
-       int err;
+       int err, failing;
 
        if (in_failure_mode(desc))
                return -EIO;
-       if (do_fail(desc, lnum, 1))
+       failing = do_fail(desc, lnum, 1);
+       if (failing)
                cut_data(buf, len);
        err = ubi_leb_write(desc, lnum, buf, offset, len, dtype);
        if (err)
                return err;
-       if (in_failure_mode(desc))
+       if (failing)
                return -EIO;
        return 0;
 }
index 3c4f1e9..50315fc 100644 (file)
@@ -27,7 +27,7 @@
 
 #define UBIFS_DBG(op) op
 
-#define ubifs_assert(expr)  do {                                               \
+#define ubifs_assert(expr) do {                                                \
        if (unlikely(!(expr))) {                                               \
                printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \
                       __func__, __LINE__, current->pid);                      \
@@ -73,50 +73,50 @@ const char *dbg_key_str1(const struct ubifs_info *c,
                         const union ubifs_key *key);
 
 /*
- * DBGKEY macros require dbg_lock to be held, which it is in the dbg message
+ * DBGKEY macros require @dbg_lock to be held, which it is in the dbg message
  * macros.
  */
 #define DBGKEY(key) dbg_key_str0(c, (key))
 #define DBGKEY1(key) dbg_key_str1(c, (key))
 
 /* General messages */
-#define dbg_gen(fmt, ...)        dbg_do_msg(UBIFS_MSG_GEN, fmt, ##__VA_ARGS__)
+#define dbg_gen(fmt, ...)   dbg_do_msg(UBIFS_MSG_GEN, fmt, ##__VA_ARGS__)
 
 /* Additional journal messages */
-#define dbg_jnl(fmt, ...)        dbg_do_msg(UBIFS_MSG_JNL, fmt, ##__VA_ARGS__)
+#define dbg_jnl(fmt, ...)   dbg_do_msg(UBIFS_MSG_JNL, fmt, ##__VA_ARGS__)
 
 /* Additional TNC messages */
-#define dbg_tnc(fmt, ...)        dbg_do_msg(UBIFS_MSG_TNC, fmt, ##__VA_ARGS__)
+#define dbg_tnc(fmt, ...)   dbg_do_msg(UBIFS_MSG_TNC, fmt, ##__VA_ARGS__)
 
 /* Additional lprops messages */
-#define dbg_lp(fmt, ...)         dbg_do_msg(UBIFS_MSG_LP, fmt, ##__VA_ARGS__)
+#define dbg_lp(fmt, ...)    dbg_do_msg(UBIFS_MSG_LP, fmt, ##__VA_ARGS__)
 
 /* Additional LEB find messages */
-#define dbg_find(fmt, ...)       dbg_do_msg(UBIFS_MSG_FIND, fmt, ##__VA_ARGS__)
+#define dbg_find(fmt, ...)  dbg_do_msg(UBIFS_MSG_FIND, fmt, ##__VA_ARGS__)
 
 /* Additional mount messages */
-#define dbg_mnt(fmt, ...)        dbg_do_msg(UBIFS_MSG_MNT, fmt, ##__VA_ARGS__)
+#define dbg_mnt(fmt, ...)   dbg_do_msg(UBIFS_MSG_MNT, fmt, ##__VA_ARGS__)
 
 /* Additional I/O messages */
-#define dbg_io(fmt, ...)         dbg_do_msg(UBIFS_MSG_IO, fmt, ##__VA_ARGS__)
+#define dbg_io(fmt, ...)    dbg_do_msg(UBIFS_MSG_IO, fmt, ##__VA_ARGS__)
 
 /* Additional commit messages */
-#define dbg_cmt(fmt, ...)        dbg_do_msg(UBIFS_MSG_CMT, fmt, ##__VA_ARGS__)
+#define dbg_cmt(fmt, ...)   dbg_do_msg(UBIFS_MSG_CMT, fmt, ##__VA_ARGS__)
 
 /* Additional budgeting messages */
-#define dbg_budg(fmt, ...)       dbg_do_msg(UBIFS_MSG_BUDG, fmt, ##__VA_ARGS__)
+#define dbg_budg(fmt, ...)  dbg_do_msg(UBIFS_MSG_BUDG, fmt, ##__VA_ARGS__)
 
 /* Additional log messages */
-#define dbg_log(fmt, ...)        dbg_do_msg(UBIFS_MSG_LOG, fmt, ##__VA_ARGS__)
+#define dbg_log(fmt, ...)   dbg_do_msg(UBIFS_MSG_LOG, fmt, ##__VA_ARGS__)
 
 /* Additional gc messages */
-#define dbg_gc(fmt, ...)         dbg_do_msg(UBIFS_MSG_GC, fmt, ##__VA_ARGS__)
+#define dbg_gc(fmt, ...)    dbg_do_msg(UBIFS_MSG_GC, fmt, ##__VA_ARGS__)
 
 /* Additional scan messages */
-#define dbg_scan(fmt, ...)       dbg_do_msg(UBIFS_MSG_SCAN, fmt, ##__VA_ARGS__)
+#define dbg_scan(fmt, ...)  dbg_do_msg(UBIFS_MSG_SCAN, fmt, ##__VA_ARGS__)
 
 /* Additional recovery messages */
-#define dbg_rcvry(fmt, ...)      dbg_do_msg(UBIFS_MSG_RCVRY, fmt, ##__VA_ARGS__)
+#define dbg_rcvry(fmt, ...) dbg_do_msg(UBIFS_MSG_RCVRY, fmt, ##__VA_ARGS__)
 
 /*
  * Debugging message type flags (must match msg_type_names in debug.c).
@@ -239,34 +239,23 @@ typedef int (*dbg_leaf_callback)(struct ubifs_info *c,
                                 struct ubifs_zbranch *zbr, void *priv);
 typedef int (*dbg_znode_callback)(struct ubifs_info *c,
                                  struct ubifs_znode *znode, void *priv);
-
 int dbg_walk_index(struct ubifs_info *c, dbg_leaf_callback leaf_cb,
                   dbg_znode_callback znode_cb, void *priv);
 
 /* Checking functions */
 
 int dbg_check_lprops(struct ubifs_info *c);
-
 int dbg_old_index_check_init(struct ubifs_info *c, struct ubifs_zbranch *zroot);
 int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot);
-
 int dbg_check_cats(struct ubifs_info *c);
-
 int dbg_check_ltab(struct ubifs_info *c);
-
 int dbg_check_synced_i_size(struct inode *inode);
-
 int dbg_check_dir_size(struct ubifs_info *c, const struct inode *dir);
-
 int dbg_check_tnc(struct ubifs_info *c, int extra);
-
 int dbg_check_idx_size(struct ubifs_info *c, long long idx_size);
-
 int dbg_check_filesystem(struct ubifs_info *c);
-
 void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat,
                    int add_pos);
-
 int dbg_check_lprops(struct ubifs_info *c);
 int dbg_check_lpt_nodes(struct ubifs_info *c, struct ubifs_cnode *cnode,
                        int row, int col);
@@ -329,71 +318,77 @@ static inline int dbg_change(struct ubi_volume_desc *desc, int lnum,
 #else /* !CONFIG_UBIFS_FS_DEBUG */
 
 #define UBIFS_DBG(op)
-#define ubifs_assert(expr)                         ({})
-#define ubifs_assert_cmt_locked(c)
+
+/* Use "if (0)" to make compiler check arguments even if debugging is off */
+#define ubifs_assert(expr)  do {                                               \
+       if (0 && (expr))                                                       \
+               printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \
+                      __func__, __LINE__, current->pid);                      \
+} while (0)
+
+#define dbg_err(fmt, ...)   do {                                               \
+       if (0)                                                                 \
+               ubifs_err(fmt, ##__VA_ARGS__);                                 \
+} while (0)
+
+#define dbg_msg(fmt, ...) do {                                                 \
+       if (0)                                                                 \
+               printk(KERN_DEBUG "UBIFS DBG (pid %d): %s: " fmt "\n",         \
+                      current->pid, __func__, ##__VA_ARGS__);                 \
+} while (0)
+
 #define dbg_dump_stack()
-#define dbg_err(fmt, ...)                          ({})
-#define dbg_msg(fmt, ...)                          ({})
-#define dbg_key(c, key, fmt, ...)                  ({})
-
-#define dbg_gen(fmt, ...)                          ({})
-#define dbg_jnl(fmt, ...)                          ({})
-#define dbg_tnc(fmt, ...)                          ({})
-#define dbg_lp(fmt, ...)                           ({})
-#define dbg_find(fmt, ...)                         ({})
-#define dbg_mnt(fmt, ...)                          ({})
-#define dbg_io(fmt, ...)                           ({})
-#define dbg_cmt(fmt, ...)                          ({})
-#define dbg_budg(fmt, ...)                         ({})
-#define dbg_log(fmt, ...)                          ({})
-#define dbg_gc(fmt, ...)                           ({})
-#define dbg_scan(fmt, ...)                         ({})
-#define dbg_rcvry(fmt, ...)                        ({})
-
-#define dbg_ntype(type)                            ""
-#define dbg_cstate(cmt_state)                      ""
-#define dbg_get_key_dump(c, key)                   ({})
-#define dbg_dump_inode(c, inode)                   ({})
-#define dbg_dump_node(c, node)                     ({})
-#define dbg_dump_budget_req(req)                   ({})
-#define dbg_dump_lstats(lst)                       ({})
-#define dbg_dump_budg(c)                           ({})
-#define dbg_dump_lprop(c, lp)                      ({})
-#define dbg_dump_lprops(c)                         ({})
-#define dbg_dump_leb(c, lnum)                      ({})
-#define dbg_dump_znode(c, znode)                   ({})
-#define dbg_dump_heap(c, heap, cat)                ({})
-#define dbg_dump_pnode(c, pnode, parent, iip)      ({})
-#define dbg_dump_tnc(c)                            ({})
-#define dbg_dump_index(c)                          ({})
+#define ubifs_assert_cmt_locked(c)
 
-#define dbg_walk_index(c, leaf_cb, znode_cb, priv) 0
+#define dbg_gen(fmt, ...)   dbg_msg(fmt, ##__VA_ARGS__)
+#define dbg_jnl(fmt, ...)   dbg_msg(fmt, ##__VA_ARGS__)
+#define dbg_tnc(fmt, ...)   dbg_msg(fmt, ##__VA_ARGS__)
+#define dbg_lp(fmt, ...)    dbg_msg(fmt, ##__VA_ARGS__)
+#define dbg_find(fmt, ...)  dbg_msg(fmt, ##__VA_ARGS__)
+#define dbg_mnt(fmt, ...)   dbg_msg(fmt, ##__VA_ARGS__)
+#define dbg_io(fmt, ...)    dbg_msg(fmt, ##__VA_ARGS__)
+#define dbg_cmt(fmt, ...)   dbg_msg(fmt, ##__VA_ARGS__)
+#define dbg_budg(fmt, ...)  dbg_msg(fmt, ##__VA_ARGS__)
+#define dbg_log(fmt, ...)   dbg_msg(fmt, ##__VA_ARGS__)
+#define dbg_gc(fmt, ...)    dbg_msg(fmt, ##__VA_ARGS__)
+#define dbg_scan(fmt, ...)  dbg_msg(fmt, ##__VA_ARGS__)
+#define dbg_rcvry(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
+
+#define DBGKEY(key)  ((char *)(key))
+#define DBGKEY1(key) ((char *)(key))
+
+#define dbg_ntype(type)                       ""
+#define dbg_cstate(cmt_state)                 ""
+#define dbg_get_key_dump(c, key)              ({})
+#define dbg_dump_inode(c, inode)              ({})
+#define dbg_dump_node(c, node)                ({})
+#define dbg_dump_budget_req(req)              ({})
+#define dbg_dump_lstats(lst)                  ({})
+#define dbg_dump_budg(c)                      ({})
+#define dbg_dump_lprop(c, lp)                 ({})
+#define dbg_dump_lprops(c)                    ({})
+#define dbg_dump_leb(c, lnum)                 ({})
+#define dbg_dump_znode(c, znode)              ({})
+#define dbg_dump_heap(c, heap, cat)           ({})
+#define dbg_dump_pnode(c, pnode, parent, iip) ({})
+#define dbg_dump_tnc(c)                       ({})
+#define dbg_dump_index(c)                     ({})
 
+#define dbg_walk_index(c, leaf_cb, znode_cb, priv) 0
 #define dbg_old_index_check_init(c, zroot)         0
 #define dbg_check_old_index(c, zroot)              0
-
 #define dbg_check_cats(c)                          0
-
 #define dbg_check_ltab(c)                          0
-
 #define dbg_check_synced_i_size(inode)             0
-
 #define dbg_check_dir_size(c, dir)                 0
-
 #define dbg_check_tnc(c, x)                        0
-
 #define dbg_check_idx_size(c, idx_size)            0
-
 #define dbg_check_filesystem(c)                    0
-
 #define dbg_check_heap(c, heap, cat, add_pos)      ({})
-
 #define dbg_check_lprops(c)                        0
 #define dbg_check_lpt_nodes(c, cnode, row, col)    0
-
 #define dbg_force_in_the_gaps_enabled              0
 #define dbg_force_in_the_gaps()                    0
-
 #define dbg_failure_mode                           0
 #define dbg_failure_mode_registration(c)           ({})
 #define dbg_failure_mode_deregistration(c)         ({})
index e90374b..5c96f1f 100644 (file)
@@ -165,7 +165,6 @@ struct inode *ubifs_new_inode(struct ubifs_info *c, const struct inode *dir,
        }
 
        inode->i_ino = ++c->highest_inum;
-       inode->i_generation = ++c->vfs_gen;
        /*
         * The creation sequence number remains with this inode for its
         * lifetime. All nodes for this inode have a greater sequence number,
@@ -220,15 +219,7 @@ static struct dentry *ubifs_lookup(struct inode *dir, struct dentry *dentry,
 
        err = ubifs_tnc_lookup_nm(c, &key, dent, &dentry->d_name);
        if (err) {
-               /*
-                * Do not hash the direntry if parent 'i_nlink' is zero, because
-                * this has side-effects - '->delete_inode()' call will not be
-                * called for the parent orphan inode, because 'd_count' of its
-                * direntry will stay 1 (it'll be negative direntry I guess)
-                * and prevent 'iput_final()' until the dentry is destroyed due
-                * to unmount or memory pressure.
-                */
-               if (err == -ENOENT && dir->i_nlink != 0) {
+               if (err == -ENOENT) {
                        dbg_gen("not found");
                        goto done;
                }
@@ -525,7 +516,7 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir,
        struct ubifs_inode *dir_ui = ubifs_inode(dir);
        int err, sz_change = CALC_DENT_SIZE(dentry->d_name.len);
        struct ubifs_budget_req req = { .new_dent = 1, .dirtied_ino = 2,
-                                       .dirtied_ino_d = ui->data_len };
+                               .dirtied_ino_d = ALIGN(ui->data_len, 8) };
 
        /*
         * Budget request settings: new direntry, changing the target inode,
@@ -727,8 +718,7 @@ static int ubifs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
        struct ubifs_inode *dir_ui = ubifs_inode(dir);
        struct ubifs_info *c = dir->i_sb->s_fs_info;
        int err, sz_change = CALC_DENT_SIZE(dentry->d_name.len);
-       struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
-                                       .dirtied_ino_d = 1 };
+       struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1 };
 
        /*
         * Budget request settings: new inode, new direntry and changing parent
@@ -789,7 +779,8 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry,
        int sz_change = CALC_DENT_SIZE(dentry->d_name.len);
        int err, devlen = 0;
        struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
-                                       .new_ino_d = devlen, .dirtied_ino = 1 };
+                                       .new_ino_d = ALIGN(devlen, 8),
+                                       .dirtied_ino = 1 };
 
        /*
         * Budget request settings: new inode, new direntry and changing parent
@@ -863,7 +854,8 @@ static int ubifs_symlink(struct inode *dir, struct dentry *dentry,
        int err, len = strlen(symname);
        int sz_change = CALC_DENT_SIZE(dentry->d_name.len);
        struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
-                                       .new_ino_d = len, .dirtied_ino = 1 };
+                                       .new_ino_d = ALIGN(len, 8),
+                                       .dirtied_ino = 1 };
 
        /*
         * Budget request settings: new inode, new direntry and changing parent
@@ -1012,7 +1004,7 @@ static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,
        struct ubifs_budget_req req = { .new_dent = 1, .mod_dent = 1,
                                        .dirtied_ino = 3 };
        struct ubifs_budget_req ino_req = { .dirtied_ino = 1,
-                               .dirtied_ino_d = old_inode_ui->data_len };
+                       .dirtied_ino_d = ALIGN(old_inode_ui->data_len, 8) };
        struct timespec time;
 
        /*
index 8565e58..4071d1c 100644 (file)
@@ -890,7 +890,7 @@ static int do_setattr(struct ubifs_info *c, struct inode *inode,
        loff_t new_size = attr->ia_size;
        struct ubifs_inode *ui = ubifs_inode(inode);
        struct ubifs_budget_req req = { .dirtied_ino = 1,
-                                       .dirtied_ino_d = ui->data_len };
+                               .dirtied_ino_d = ALIGN(ui->data_len, 8) };
 
        err = ubifs_budget_space(c, &req);
        if (err)
@@ -941,7 +941,8 @@ int ubifs_setattr(struct dentry *dentry, struct iattr *attr)
        struct inode *inode = dentry->d_inode;
        struct ubifs_info *c = inode->i_sb->s_fs_info;
 
-       dbg_gen("ino %lu, ia_valid %#x", inode->i_ino, attr->ia_valid);
+       dbg_gen("ino %lu, mode %#x, ia_valid %#x",
+               inode->i_ino, inode->i_mode, attr->ia_valid);
        err = inode_change_ok(inode, attr);
        if (err)
                return err;
@@ -1051,7 +1052,7 @@ static int update_mctime(struct ubifs_info *c, struct inode *inode)
        if (mctime_update_needed(inode, &now)) {
                int err, release;
                struct ubifs_budget_req req = { .dirtied_ino = 1,
-                                               .dirtied_ino_d = ui->data_len };
+                               .dirtied_ino_d = ALIGN(ui->data_len, 8) };
 
                err = ubifs_budget_space(c, &req);
                if (err)
@@ -1270,6 +1271,7 @@ struct file_operations ubifs_file_operations = {
        .fsync          = ubifs_fsync,
        .unlocked_ioctl = ubifs_ioctl,
        .splice_read    = generic_file_splice_read,
+       .splice_write   = generic_file_splice_write,
 #ifdef CONFIG_COMPAT
        .compat_ioctl   = ubifs_compat_ioctl,
 #endif
index 10394c5..adee7b5 100644 (file)
@@ -290,9 +290,14 @@ int ubifs_find_dirty_leb(struct ubifs_info *c, struct ubifs_lprops *ret_lp,
                idx_lp = idx_heap->arr[0];
                sum = idx_lp->free + idx_lp->dirty;
                /*
-                * Since we reserve twice as more space for the index than it
+                * Since we reserve thrice as much space for the index than it
                 * actually takes, it does not make sense to pick indexing LEBs
-                * with less than half LEB of dirty space.
+                * with less than, say, half LEB of dirty space. May be half is
+                * not the optimal boundary - this should be tested and
+                * checked. This boundary should determine how much we use
+                * in-the-gaps to consolidate the index comparing to how much
+                * we use garbage collector to consolidate it. The "half"
+                * criteria just feels to be fine.
                 */
                if (sum < min_space || sum < c->half_leb_size)
                        idx_lp = NULL;
index 3374f91..054363f 100644 (file)
 #include <linux/crc32.h>
 #include "ubifs.h"
 
+/**
+ * ubifs_ro_mode - switch UBIFS to read read-only mode.
+ * @c: UBIFS file-system description object
+ * @err: error code which is the reason of switching to R/O mode
+ */
+void ubifs_ro_mode(struct ubifs_info *c, int err)
+{
+       if (!c->ro_media) {
+               c->ro_media = 1;
+               ubifs_warn("switched to read-only mode, error %d", err);
+               dbg_dump_stack();
+       }
+}
+
 /**
  * ubifs_check_node - check node.
  * @c: UBIFS file-system description object
index 283155a..22993f8 100644 (file)
@@ -447,13 +447,11 @@ static int get_dent_type(int mode)
  * @ino: buffer in which to pack inode node
  * @inode: inode to pack
  * @last: indicates the last node of the group
- * @last_reference: non-zero if this is a deletion inode
  */
 static void pack_inode(struct ubifs_info *c, struct ubifs_ino_node *ino,
-                      const struct inode *inode, int last,
-                      int last_reference)
+                      const struct inode *inode, int last)
 {
-       int data_len = 0;
+       int data_len = 0, last_reference = !inode->i_nlink;
        struct ubifs_inode *ui = ubifs_inode(inode);
 
        ino->ch.node_type = UBIFS_INO_NODE;
@@ -596,9 +594,9 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
        ubifs_prep_grp_node(c, dent, dlen, 0);
 
        ino = (void *)dent + aligned_dlen;
-       pack_inode(c, ino, inode, 0, last_reference);
+       pack_inode(c, ino, inode, 0);
        ino = (void *)ino + aligned_ilen;
-       pack_inode(c, ino, dir, 1, 0);
+       pack_inode(c, ino, dir, 1);
 
        if (last_reference) {
                err = ubifs_add_orphan(c, inode->i_ino);
@@ -606,6 +604,7 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
                        release_head(c, BASEHD);
                        goto out_finish;
                }
+               ui->del_cmtno = c->cmt_no;
        }
 
        err = write_head(c, BASEHD, dent, len, &lnum, &dent_offs, sync);
@@ -750,30 +749,25 @@ out_free:
  * ubifs_jnl_write_inode - flush inode to the journal.
  * @c: UBIFS file-system description object
  * @inode: inode to flush
- * @deletion: inode has been deleted
  *
  * This function writes inode @inode to the journal. If the inode is
  * synchronous, it also synchronizes the write-buffer. Returns zero in case of
  * success and a negative error code in case of failure.
  */
-int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode,
-                         int deletion)
+int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode)
 {
-       int err, len, lnum, offs, sync = 0;
+       int err, lnum, offs;
        struct ubifs_ino_node *ino;
        struct ubifs_inode *ui = ubifs_inode(inode);
+       int sync = 0, len = UBIFS_INO_NODE_SZ, last_reference = !inode->i_nlink;
 
-       dbg_jnl("ino %lu%s", inode->i_ino,
-               deletion ? " (last reference)" : "");
-       if (deletion)
-               ubifs_assert(inode->i_nlink == 0);
+       dbg_jnl("ino %lu, nlink %u", inode->i_ino, inode->i_nlink);
 
-       len = UBIFS_INO_NODE_SZ;
        /*
         * If the inode is being deleted, do not write the attached data. No
         * need to synchronize the write-buffer either.
         */
-       if (!deletion) {
+       if (!last_reference) {
                len += ui->data_len;
                sync = IS_SYNC(inode);
        }
@@ -786,7 +780,7 @@ int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode,
        if (err)
                goto out_free;
 
-       pack_inode(c, ino, inode, 1, deletion);
+       pack_inode(c, ino, inode, 1);
        err = write_head(c, BASEHD, ino, len, &lnum, &offs, sync);
        if (err)
                goto out_release;
@@ -795,7 +789,7 @@ int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode,
                                          inode->i_ino);
        release_head(c, BASEHD);
 
-       if (deletion) {
+       if (last_reference) {
                err = ubifs_tnc_remove_ino(c, inode->i_ino);
                if (err)
                        goto out_ro;
@@ -827,6 +821,65 @@ out_free:
        return err;
 }
 
+/**
+ * ubifs_jnl_delete_inode - delete an inode.
+ * @c: UBIFS file-system description object
+ * @inode: inode to delete
+ *
+ * This function deletes inode @inode which includes removing it from orphans,
+ * deleting it from TNC and, in some cases, writing a deletion inode to the
+ * journal.
+ *
+ * When regular file inodes are unlinked or a directory inode is removed, the
+ * 'ubifs_jnl_update()' function writes a corresponding deletion inode and
+ * direntry to the media, and adds the inode to orphans. After this, when the
+ * last reference to this inode has been dropped, this function is called. In
+ * general, it has to write one more deletion inode to the media, because if
+ * a commit happened between 'ubifs_jnl_update()' and
+ * 'ubifs_jnl_delete_inode()', the deletion inode is not in the journal
+ * anymore, and in fact it might not be on the flash anymore, because it might
+ * have been garbage-collected already. And for optimization reasons UBIFS does
+ * not read the orphan area if it has been unmounted cleanly, so it would have
+ * no indication in the journal that there is a deleted inode which has to be
+ * removed from TNC.
+ *
+ * However, if there was no commit between 'ubifs_jnl_update()' and
+ * 'ubifs_jnl_delete_inode()', then there is no need to write the deletion
+ * inode to the media for the second time. And this is quite a typical case.
+ *
+ * This function returns zero in case of success and a negative error code in
+ * case of failure.
+ */
+int ubifs_jnl_delete_inode(struct ubifs_info *c, const struct inode *inode)
+{
+       int err;
+       struct ubifs_inode *ui = ubifs_inode(inode);
+
+       ubifs_assert(inode->i_nlink == 0);
+
+       if (ui->del_cmtno != c->cmt_no)
+               /* A commit happened for sure */
+               return ubifs_jnl_write_inode(c, inode);
+
+       down_read(&c->commit_sem);
+       /*
+        * Check commit number again, because the first test has been done
+        * without @c->commit_sem, so a commit might have happened.
+        */
+       if (ui->del_cmtno != c->cmt_no) {
+               up_read(&c->commit_sem);
+               return ubifs_jnl_write_inode(c, inode);
+       }
+
+       err = ubifs_tnc_remove_ino(c, inode->i_ino);
+       if (err)
+               ubifs_ro_mode(c, err);
+       else
+               ubifs_delete_orphan(c, inode->i_ino);
+       up_read(&c->commit_sem);
+       return err;
+}
+
 /**
  * ubifs_jnl_rename - rename a directory entry.
  * @c: UBIFS file-system description object
@@ -917,16 +970,16 @@ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,
 
        p = (void *)dent2 + aligned_dlen2;
        if (new_inode) {
-               pack_inode(c, p, new_inode, 0, last_reference);
+               pack_inode(c, p, new_inode, 0);
                p += ALIGN(ilen, 8);
        }
 
        if (!move)
-               pack_inode(c, p, old_dir, 1, 0);
+               pack_inode(c, p, old_dir, 1);
        else {
-               pack_inode(c, p, old_dir, 0, 0);
+               pack_inode(c, p, old_dir, 0);
                p += ALIGN(plen, 8);
-               pack_inode(c, p, new_dir, 1, 0);
+               pack_inode(c, p, new_dir, 1);
        }
 
        if (last_reference) {
@@ -935,6 +988,7 @@ int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,
                        release_head(c, BASEHD);
                        goto out_finish;
                }
+               new_ui->del_cmtno = c->cmt_no;
        }
 
        err = write_head(c, BASEHD, dent, len, &lnum, &offs, sync);
@@ -1131,7 +1185,7 @@ int ubifs_jnl_truncate(struct ubifs_info *c, const struct inode *inode,
        if (err)
                goto out_free;
 
-       pack_inode(c, ino, inode, 0, 0);
+       pack_inode(c, ino, inode, 0);
        ubifs_prep_grp_node(c, trun, UBIFS_TRUN_NODE_SZ, dlen ? 0 : 1);
        if (dlen)
                ubifs_prep_grp_node(c, dn, dlen, 1);
@@ -1251,9 +1305,9 @@ int ubifs_jnl_delete_xattr(struct ubifs_info *c, const struct inode *host,
        ubifs_prep_grp_node(c, xent, xlen, 0);
 
        ino = (void *)xent + aligned_xlen;
-       pack_inode(c, ino, inode, 0, 1);
+       pack_inode(c, ino, inode, 0);
        ino = (void *)ino + UBIFS_INO_NODE_SZ;
-       pack_inode(c, ino, host, 1, 0);
+       pack_inode(c, ino, host, 1);
 
        err = write_head(c, BASEHD, xent, len, &lnum, &xent_offs, sync);
        if (!sync && !err)
@@ -1320,7 +1374,7 @@ int ubifs_jnl_change_xattr(struct ubifs_info *c, const struct inode *inode,
                           const struct inode *host)
 {
        int err, len1, len2, aligned_len, aligned_len1, lnum, offs;
-       struct ubifs_inode *host_ui = ubifs_inode(inode);
+       struct ubifs_inode *host_ui = ubifs_inode(host);
        struct ubifs_ino_node *ino;
        union ubifs_key key;
        int sync = IS_DIRSYNC(host);
@@ -1344,8 +1398,8 @@ int ubifs_jnl_change_xattr(struct ubifs_info *c, const struct inode *inode,
        if (err)
                goto out_free;
 
-       pack_inode(c, ino, host, 0, 0);
-       pack_inode(c, (void *)ino + aligned_len1, inode, 1, 0);
+       pack_inode(c, ino, host, 0);
+       pack_inode(c, (void *)ino + aligned_len1, inode, 1);
 
        err = write_head(c, BASEHD, ino, aligned_len, &lnum, &offs, 0);
        if (!sync && !err) {
index 36857b9..3e0aa73 100644 (file)
@@ -317,6 +317,8 @@ int ubifs_add_bud_to_log(struct ubifs_info *c, int jhead, int lnum, int offs)
        return 0;
 
 out_unlock:
+       if (err != -EAGAIN)
+               ubifs_ro_mode(c, err);
        mutex_unlock(&c->log_mutex);
        kfree(ref);
        kfree(bud);
@@ -410,7 +412,7 @@ int ubifs_log_start_commit(struct ubifs_info *c, int *ltail_lnum)
                return -ENOMEM;
 
        cs->ch.node_type = UBIFS_CS_NODE;
-       cs->cmt_no = cpu_to_le64(c->cmt_no + 1);
+       cs->cmt_no = cpu_to_le64(c->cmt_no);
        ubifs_prepare_node(c, cs, UBIFS_CS_NODE_SZ, 0);
 
        /*
index 4beccfc..87dabf9 100644 (file)
@@ -79,20 +79,6 @@ static inline struct ubifs_inode *ubifs_inode(const struct inode *inode)
        return container_of(inode, struct ubifs_inode, vfs_inode);
 }
 
-/**
- * ubifs_ro_mode - switch UBIFS to read read-only mode.
- * @c: UBIFS file-system description object
- * @err: error code which is the reason of switching to R/O mode
- */
-static inline void ubifs_ro_mode(struct ubifs_info *c, int err)
-{
-       if (!c->ro_media) {
-               c->ro_media = 1;
-               ubifs_warn("switched to read-only mode, error %d", err);
-               dbg_dump_stack();
-       }
-}
-
 /**
  * ubifs_compr_present - check if compressor was compiled in.
  * @compr_type: compressor type to check
@@ -322,7 +308,7 @@ static inline long long ubifs_reported_space(const struct ubifs_info *c,
 {
        int divisor, factor;
 
-       divisor = UBIFS_MAX_DATA_NODE_SZ + (c->max_idx_node_sz << 1);
+       divisor = UBIFS_MAX_DATA_NODE_SZ + (c->max_idx_node_sz * 3);
        factor = UBIFS_MAX_DATA_NODE_SZ - UBIFS_DATA_NODE_SZ;
        do_div(free, divisor);
 
index 3afeb92..02d3462 100644 (file)
@@ -310,10 +310,10 @@ static int write_orph_node(struct ubifs_info *c, int atomic)
        c->cmt_orphans -= cnt;
        spin_unlock(&c->orphan_lock);
        if (c->cmt_orphans)
-               orph->cmt_no = cpu_to_le64(c->cmt_no + 1);
+               orph->cmt_no = cpu_to_le64(c->cmt_no);
        else
                /* Mark the last node of the commit */
-               orph->cmt_no = cpu_to_le64((c->cmt_no + 1) | (1ULL << 63));
+               orph->cmt_no = cpu_to_le64((c->cmt_no) | (1ULL << 63));
        ubifs_assert(c->ohead_offs + len <= c->leb_size);
        ubifs_assert(c->ohead_lnum >= c->orph_first);
        ubifs_assert(c->ohead_lnum <= c->orph_last);
index ca1e2d4..f71e6b8 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/ctype.h>
-#include <linux/random.h>
 #include <linux/kthread.h>
 #include <linux/parser.h>
 #include <linux/seq_file.h>
@@ -149,7 +148,7 @@ struct inode *ubifs_iget(struct super_block *sb, unsigned long inum)
        if (err)
                goto out_invalid;
 
-       /* Disable readahead */
+       /* Disable read-ahead */
        inode->i_mapping->backing_dev_info = &c->bdi;
 
        switch (inode->i_mode & S_IFMT) {
@@ -278,7 +277,7 @@ static void ubifs_destroy_inode(struct inode *inode)
  */
 static int ubifs_write_inode(struct inode *inode, int wait)
 {
-       int err;
+       int err = 0;
        struct ubifs_info *c = inode->i_sb->s_fs_info;
        struct ubifs_inode *ui = ubifs_inode(inode);
 
@@ -299,10 +298,18 @@ static int ubifs_write_inode(struct inode *inode, int wait)
                return 0;
        }
 
-       dbg_gen("inode %lu", inode->i_ino);
-       err = ubifs_jnl_write_inode(c, inode, 0);
-       if (err)
-               ubifs_err("can't write inode %lu, error %d", inode->i_ino, err);
+       /*
+        * As an optimization, do not write orphan inodes to the media just
+        * because this is not needed.
+        */
+       dbg_gen("inode %lu, mode %#x, nlink %u",
+               inode->i_ino, (int)inode->i_mode, inode->i_nlink);
+       if (inode->i_nlink) {
+               err = ubifs_jnl_write_inode(c, inode);
+               if (err)
+                       ubifs_err("can't write inode %lu, error %d",
+                                 inode->i_ino, err);
+       }
 
        ui->dirty = 0;
        mutex_unlock(&ui->ui_mutex);
@@ -314,8 +321,9 @@ static void ubifs_delete_inode(struct inode *inode)
 {
        int err;
        struct ubifs_info *c = inode->i_sb->s_fs_info;
+       struct ubifs_inode *ui = ubifs_inode(inode);
 
-       if (ubifs_inode(inode)->xattr)
+       if (ui->xattr)
                /*
                 * Extended attribute inode deletions are fully handled in
                 * 'ubifs_removexattr()'. These inodes are special and have
@@ -323,7 +331,7 @@ static void ubifs_delete_inode(struct inode *inode)
                 */
                goto out;
 
-       dbg_gen("inode %lu", inode->i_ino);
+       dbg_gen("inode %lu, mode %#x", inode->i_ino, (int)inode->i_mode);
        ubifs_assert(!atomic_read(&inode->i_count));
        ubifs_assert(inode->i_nlink == 0);
 
@@ -331,15 +339,19 @@ static void ubifs_delete_inode(struct inode *inode)
        if (is_bad_inode(inode))
                goto out;
 
-       ubifs_inode(inode)->ui_size = inode->i_size = 0;
-       err = ubifs_jnl_write_inode(c, inode, 1);
+       ui->ui_size = inode->i_size = 0;
+       err = ubifs_jnl_delete_inode(c, inode);
        if (err)
                /*
                 * Worst case we have a lost orphan inode wasting space, so a
-                * simple error message is ok here.
+                * simple error message is OK here.
                 */
-               ubifs_err("can't write inode %lu, error %d", inode->i_ino, err);
+               ubifs_err("can't delete inode %lu, error %d",
+                         inode->i_ino, err);
+
 out:
+       if (ui->dirty)
+               ubifs_release_dirty_inode_budget(c, ui);
        clear_inode(inode);
 }
 
@@ -1122,8 +1134,8 @@ static int mount_ubifs(struct ubifs_info *c)
        if (err)
                goto out_infos;
 
-       ubifs_msg("mounted UBI device %d, volume %d", c->vi.ubi_num,
-                 c->vi.vol_id);
+       ubifs_msg("mounted UBI device %d, volume %d, name \"%s\"",
+                 c->vi.ubi_num, c->vi.vol_id, c->vi.name);
        if (mounted_read_only)
                ubifs_msg("mounted read-only");
        x = (long long)c->main_lebs * c->leb_size;
@@ -1469,6 +1481,7 @@ static void ubifs_put_super(struct super_block *sb)
         */
        ubifs_assert(atomic_long_read(&c->dirty_pg_cnt) == 0);
        ubifs_assert(c->budg_idx_growth == 0);
+       ubifs_assert(c->budg_dd_growth == 0);
        ubifs_assert(c->budg_data_growth == 0);
 
        /*
@@ -1657,7 +1670,6 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
        INIT_LIST_HEAD(&c->orph_new);
 
        c->highest_inum = UBIFS_FIRST_INO;
-       get_random_bytes(&c->vfs_gen, sizeof(int));
        c->lhead_lnum = c->ltail_lnum = UBIFS_LOG_LNUM;
 
        ubi_get_volume_info(ubi, &c->vi);
@@ -1671,10 +1683,10 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
        }
 
        /*
-        * UBIFS provids 'backing_dev_info' in order to disable readahead. For
+        * UBIFS provides 'backing_dev_info' in order to disable read-ahead. For
         * UBIFS, I/O is not deferred, it is done immediately in readpage,
         * which means the user would have to wait not just for their own I/O
-        * but the readahead I/O as well i.e. completely pointless.
+        * but the read-ahead I/O as well i.e. completely pointless.
         *
         * Read-ahead will be disabled because @c->bdi.ra_pages is 0.
         */
index 8117e65..8ac76b1 100644 (file)
@@ -372,26 +372,25 @@ static int layout_in_gaps(struct ubifs_info *c, int cnt)
                written = layout_leb_in_gaps(c, p);
                if (written < 0) {
                        err = written;
-                       if (err == -ENOSPC) {
-                               if (!dbg_force_in_the_gaps_enabled) {
-                                       /*
-                                        * Do not print scary warnings if the
-                                        * debugging option which forces
-                                        * in-the-gaps is enabled.
-                                        */
-                                       ubifs_err("out of space");
-                                       spin_lock(&c->space_lock);
-                                       dbg_dump_budg(c);
-                                       spin_unlock(&c->space_lock);
-                                       dbg_dump_lprops(c);
-                               }
-                               /* Try to commit anyway */
-                               err = 0;
-                               break;
+                       if (err != -ENOSPC) {
+                               kfree(c->gap_lebs);
+                               c->gap_lebs = NULL;
+                               return err;
                        }
-                       kfree(c->gap_lebs);
-                       c->gap_lebs = NULL;
-                       return err;
+                       if (!dbg_force_in_the_gaps_enabled) {
+                               /*
+                                * Do not print scary warnings if the debugging
+                                * option which forces in-the-gaps is enabled.
+                                */
+                               ubifs_err("out of space");
+                               spin_lock(&c->space_lock);
+                               dbg_dump_budg(c);
+                               spin_unlock(&c->space_lock);
+                               dbg_dump_lprops(c);
+                       }
+                       /* Try to commit anyway */
+                       err = 0;
+                       break;
                }
                p++;
                cnt -= written;
index 0cc7da9..bd2121f 100644 (file)
@@ -228,10 +228,10 @@ enum {
 /* Minimum number of orphan area logical eraseblocks */
 #define UBIFS_MIN_ORPH_LEBS 1
 /*
- * Minimum number of main area logical eraseblocks (buds, 2 for the index, 1
+ * Minimum number of main area logical eraseblocks (buds, 3 for the index, 1
  * for GC, 1 for deletions, and at least 1 for committed data).
  */
-#define UBIFS_MIN_MAIN_LEBS (UBIFS_MIN_BUD_LEBS + 5)
+#define UBIFS_MIN_MAIN_LEBS (UBIFS_MIN_BUD_LEBS + 6)
 
 /* Minimum number of logical eraseblocks */
 #define UBIFS_MIN_LEB_CNT (UBIFS_SB_LEBS + UBIFS_MST_LEBS + \
index e4f89f2..d7f706f 100644 (file)
@@ -20,8 +20,6 @@
  *          Adrian Hunter
  */
 
-/* Implementation version 0.7 */
-
 #ifndef __UBIFS_H__
 #define __UBIFS_H__
 
@@ -322,6 +320,8 @@ struct ubifs_gced_idx_leb {
  * struct ubifs_inode - UBIFS in-memory inode description.
  * @vfs_inode: VFS inode description object
  * @creat_sqnum: sequence number at time of creation
+ * @del_cmtno: commit number corresponding to the time the inode was deleted,
+ *             protected by @c->commit_sem;
  * @xattr_size: summarized size of all extended attributes in bytes
  * @xattr_cnt: count of extended attributes this inode has
  * @xattr_names: sum of lengths of all extended attribute names belonging to
@@ -373,6 +373,7 @@ struct ubifs_gced_idx_leb {
 struct ubifs_inode {
        struct inode vfs_inode;
        unsigned long long creat_sqnum;
+       unsigned long long del_cmtno;
        unsigned int xattr_size;
        unsigned int xattr_cnt;
        unsigned int xattr_names;
@@ -779,7 +780,7 @@ struct ubifs_compressor {
 /**
  * struct ubifs_budget_req - budget requirements of an operation.
  *
- * @fast: non-zero if the budgeting should try to aquire budget quickly and
+ * @fast: non-zero if the budgeting should try to acquire budget quickly and
  *        should not try to call write-back
  * @recalculate: non-zero if @idx_growth, @data_growth, and @dd_growth fields
  *               have to be re-calculated
@@ -805,21 +806,31 @@ struct ubifs_compressor {
  * An inode may contain 4KiB of data at max., thus the widths of @new_ino_d
  * is 13 bits, and @dirtied_ino_d - 15, because up to 4 inodes may be made
  * dirty by the re-name operation.
+ *
+ * Note, UBIFS aligns node lengths to 8-bytes boundary, so the requester has to
+ * make sure the amount of inode data which contribute to @new_ino_d and
+ * @dirtied_ino_d fields are aligned.
  */
 struct ubifs_budget_req {
        unsigned int fast:1;
        unsigned int recalculate:1;
+#ifndef UBIFS_DEBUG
        unsigned int new_page:1;
        unsigned int dirtied_page:1;
        unsigned int new_dent:1;
        unsigned int mod_dent:1;
        unsigned int new_ino:1;
        unsigned int new_ino_d:13;
-#ifndef UBIFS_DEBUG
        unsigned int dirtied_ino:4;
        unsigned int dirtied_ino_d:15;
 #else
        /* Not bit-fields to check for overflows */
+       unsigned int new_page;
+       unsigned int dirtied_page;
+       unsigned int new_dent;
+       unsigned int mod_dent;
+       unsigned int new_ino;
+       unsigned int new_ino_d;
        unsigned int dirtied_ino;
        unsigned int dirtied_ino_d;
 #endif
@@ -860,13 +871,13 @@ struct ubifs_mount_opts {
  * struct ubifs_info - UBIFS file-system description data structure
  * (per-superblock).
  * @vfs_sb: VFS @struct super_block object
- * @bdi: backing device info object to make VFS happy and disable readahead
+ * @bdi: backing device info object to make VFS happy and disable read-ahead
  *
  * @highest_inum: highest used inode number
- * @vfs_gen: VFS inode generation counter
  * @max_sqnum: current global sequence number
- * @cmt_no: commit number (last successfully completed commit)
- * @cnt_lock: protects @highest_inum, @vfs_gen, and @max_sqnum counters
+ * @cmt_no: commit number of the last successfully completed commit, protected
+ *          by @commit_sem
+ * @cnt_lock: protects @highest_inum and @max_sqnum counters
  * @fmt_version: UBIFS on-flash format version
  * @uuid: UUID from super block
  *
@@ -1103,7 +1114,6 @@ struct ubifs_info {
        struct backing_dev_info bdi;
 
        ino_t highest_inum;
-       unsigned int vfs_gen;
        unsigned long long max_sqnum;
        unsigned long long cmt_no;
        spinlock_t cnt_lock;
@@ -1346,6 +1356,7 @@ extern struct backing_dev_info ubifs_backing_dev_info;
 extern struct ubifs_compressor *ubifs_compressors[UBIFS_COMPR_TYPES_CNT];
 
 /* io.c */
+void ubifs_ro_mode(struct ubifs_info *c, int err);
 int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len);
 int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf, int lnum, int offs,
                           int dtype);
@@ -1399,8 +1410,8 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir,
                     int deletion, int xent);
 int ubifs_jnl_write_data(struct ubifs_info *c, const struct inode *inode,
                         const union ubifs_key *key, const void *buf, int len);
-int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode,
-                         int last_reference);
+int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode);
+int ubifs_jnl_delete_inode(struct ubifs_info *c, const struct inode *inode);
 int ubifs_jnl_rename(struct ubifs_info *c, const struct inode *old_dir,
                     const struct dentry *old_dentry,
                     const struct inode *new_dir,
index 1388a07..649bec7 100644 (file)
@@ -61,7 +61,7 @@
 
 /*
  * Limit the number of extended attributes per inode so that the total size
- * (xattr_size) is guaranteeded to fit in an 'unsigned int'.
+ * (@xattr_size) is guaranteeded to fit in an 'unsigned int'.
  */
 #define MAX_XATTRS_PER_INODE 65535
 
@@ -103,14 +103,14 @@ static int create_xattr(struct ubifs_info *c, struct inode *host,
        struct inode *inode;
        struct ubifs_inode *ui, *host_ui = ubifs_inode(host);
        struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
-                                       .new_ino_d = size, .dirtied_ino = 1,
-                                       .dirtied_ino_d = host_ui->data_len};
+                               .new_ino_d = ALIGN(size, 8), .dirtied_ino = 1,
+                               .dirtied_ino_d = ALIGN(host_ui->data_len, 8) };
 
        if (host_ui->xattr_cnt >= MAX_XATTRS_PER_INODE)
                return -ENOSPC;
        /*
         * Linux limits the maximum size of the extended attribute names list
-        * to %XATTR_LIST_MAX. This means we should not allow creating more*
+        * to %XATTR_LIST_MAX. This means we should not allow creating more
         * extended attributes if the name list becomes larger. This limitation
         * is artificial for UBIFS, though.
         */
@@ -128,7 +128,6 @@ static int create_xattr(struct ubifs_info *c, struct inode *host,
                goto out_budg;
        }
 
-       mutex_lock(&host_ui->ui_mutex);
        /* Re-define all operations to be "nothing" */
        inode->i_mapping->a_ops = &none_address_operations;
        inode->i_op = &none_inode_operations;
@@ -141,23 +140,19 @@ static int create_xattr(struct ubifs_info *c, struct inode *host,
        ui->data = kmalloc(size, GFP_NOFS);
        if (!ui->data) {
                err = -ENOMEM;
-               goto out_unlock;
+               goto out_free;
        }
-
        memcpy(ui->data, value, size);
+       inode->i_size = ui->ui_size = size;
+       ui->data_len = size;
+
+       mutex_lock(&host_ui->ui_mutex);
        host->i_ctime = ubifs_current_time(host);
        host_ui->xattr_cnt += 1;
        host_ui->xattr_size += CALC_DENT_SIZE(nm->len);
        host_ui->xattr_size += CALC_XATTR_BYTES(size);
        host_ui->xattr_names += nm->len;
 
-       /*
-        * We do not use i_size_write() because nobody can race with us as we
-        * are holding host @host->i_mutex - every xattr operation for this
-        * inode is serialized by it.
-        */
-       inode->i_size = ui->ui_size = size;
-       ui->data_len = size;
        err = ubifs_jnl_update(c, host, nm, inode, 0, 1);
        if (err)
                goto out_cancel;
@@ -172,8 +167,8 @@ out_cancel:
        host_ui->xattr_cnt -= 1;
        host_ui->xattr_size -= CALC_DENT_SIZE(nm->len);
        host_ui->xattr_size -= CALC_XATTR_BYTES(size);
-out_unlock:
        mutex_unlock(&host_ui->ui_mutex);
+out_free:
        make_bad_inode(inode);
        iput(inode);
 out_budg:
@@ -200,29 +195,28 @@ static int change_xattr(struct ubifs_info *c, struct inode *host,
        struct ubifs_inode *host_ui = ubifs_inode(host);
        struct ubifs_inode *ui = ubifs_inode(inode);
        struct ubifs_budget_req req = { .dirtied_ino = 2,
-                               .dirtied_ino_d = size + host_ui->data_len };
+               .dirtied_ino_d = ALIGN(size, 8) + ALIGN(host_ui->data_len, 8) };
 
        ubifs_assert(ui->data_len == inode->i_size);
        err = ubifs_budget_space(c, &req);
        if (err)
                return err;
 
-       mutex_lock(&host_ui->ui_mutex);
-       host->i_ctime = ubifs_current_time(host);
-       host_ui->xattr_size -= CALC_XATTR_BYTES(ui->data_len);
-       host_ui->xattr_size += CALC_XATTR_BYTES(size);
-
        kfree(ui->data);
        ui->data = kmalloc(size, GFP_NOFS);
        if (!ui->data) {
                err = -ENOMEM;
-               goto out_unlock;
+               goto out_free;
        }
-
        memcpy(ui->data, value, size);
        inode->i_size = ui->ui_size = size;
        ui->data_len = size;
 
+       mutex_lock(&host_ui->ui_mutex);
+       host->i_ctime = ubifs_current_time(host);
+       host_ui->xattr_size -= CALC_XATTR_BYTES(ui->data_len);
+       host_ui->xattr_size += CALC_XATTR_BYTES(size);
+
        /*
         * It is important to write the host inode after the xattr inode
         * because if the host inode gets synchronized (via 'fsync()'), then
@@ -240,9 +234,9 @@ static int change_xattr(struct ubifs_info *c, struct inode *host,
 out_cancel:
        host_ui->xattr_size -= CALC_XATTR_BYTES(size);
        host_ui->xattr_size += CALC_XATTR_BYTES(ui->data_len);
-       make_bad_inode(inode);
-out_unlock:
        mutex_unlock(&host_ui->ui_mutex);
+       make_bad_inode(inode);
+out_free:
        ubifs_release_budget(c, &req);
        return err;
 }
@@ -312,6 +306,7 @@ int ubifs_setxattr(struct dentry *dentry, const char *name,
 
        dbg_gen("xattr '%s', host ino %lu ('%.*s'), size %zd", name,
                host->i_ino, dentry->d_name.len, dentry->d_name.name, size);
+       ubifs_assert(mutex_is_locked(&host->i_mutex));
 
        if (size > UBIFS_MAX_INO_DATA)
                return -ERANGE;
@@ -384,7 +379,6 @@ ssize_t ubifs_getxattr(struct dentry *dentry, const char *name, void *buf,
        if (!xent)
                return -ENOMEM;
 
-       mutex_lock(&host->i_mutex);
        xent_key_init(c, &key, host->i_ino, &nm);
        err = ubifs_tnc_lookup_nm(c, &key, xent, &nm);
        if (err) {
@@ -419,7 +413,6 @@ ssize_t ubifs_getxattr(struct dentry *dentry, const char *name, void *buf,
 out_iput:
        iput(inode);
 out_unlock:
-       mutex_unlock(&host->i_mutex);
        kfree(xent);
        return err;
 }
@@ -449,8 +442,6 @@ ssize_t ubifs_listxattr(struct dentry *dentry, char *buffer, size_t size)
                return -ERANGE;
 
        lowest_xent_key(c, &key, host->i_ino);
-
-       mutex_lock(&host->i_mutex);
        while (1) {
                int type;
 
@@ -479,7 +470,6 @@ ssize_t ubifs_listxattr(struct dentry *dentry, char *buffer, size_t size)
                pxent = xent;
                key_read(c, &xent->key, &key);
        }
-       mutex_unlock(&host->i_mutex);
 
        kfree(pxent);
        if (err != -ENOENT) {
@@ -497,8 +487,8 @@ static int remove_xattr(struct ubifs_info *c, struct inode *host,
        int err;
        struct ubifs_inode *host_ui = ubifs_inode(host);
        struct ubifs_inode *ui = ubifs_inode(inode);
-       struct ubifs_budget_req req = { .dirtied_ino = 1, .mod_dent = 1,
-                                       .dirtied_ino_d = host_ui->data_len };
+       struct ubifs_budget_req req = { .dirtied_ino = 2, .mod_dent = 1,
+                               .dirtied_ino_d = ALIGN(host_ui->data_len, 8) };
 
        ubifs_assert(ui->data_len == inode->i_size);
 
diff --git a/include/asm-alpha/8253pit.h b/include/asm-alpha/8253pit.h
deleted file mode 100644 (file)
index fef5c14..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * 8253/8254 Programmable Interval Timer
- */
-
-#ifndef _8253PIT_H
-#define _8253PIT_H
-
-#define PIT_TICK_RATE  1193180UL
-
-#endif
diff --git a/include/asm-alpha/Kbuild b/include/asm-alpha/Kbuild
deleted file mode 100644 (file)
index b7c8f18..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-include include/asm-generic/Kbuild.asm
-
-header-y += gentrap.h
-header-y += regdef.h
-header-y += pal.h
-header-y += reg.h
-
-unifdef-y += console.h
-unifdef-y += fpu.h
-unifdef-y += sysinfo.h
-unifdef-y += compiler.h
diff --git a/include/asm-alpha/a.out-core.h b/include/asm-alpha/a.out-core.h
deleted file mode 100644 (file)
index 9e33e92..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* a.out coredump register dumper
- *
- * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
- * Written by David Howells (dhowells@redhat.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public Licence
- * as published by the Free Software Foundation; either version
- * 2 of the Licence, or (at your option) any later version.
- */
-
-#ifndef _ASM_A_OUT_CORE_H
-#define _ASM_A_OUT_CORE_H
-
-#ifdef __KERNEL__
-
-#include <linux/user.h>
-
-/*
- * Fill in the user structure for an ECOFF core dump.
- */
-static inline void aout_dump_thread(struct pt_regs *pt, struct user *dump)
-{
-       /* switch stack follows right below pt_regs: */
-       struct switch_stack * sw = ((struct switch_stack *) pt) - 1;
-
-       dump->magic = CMAGIC;
-       dump->start_code  = current->mm->start_code;
-       dump->start_data  = current->mm->start_data;
-       dump->start_stack = rdusp() & ~(PAGE_SIZE - 1);
-       dump->u_tsize = ((current->mm->end_code - dump->start_code)
-                        >> PAGE_SHIFT);
-       dump->u_dsize = ((current->mm->brk + PAGE_SIZE-1 - dump->start_data)
-                        >> PAGE_SHIFT);
-       dump->u_ssize = (current->mm->start_stack - dump->start_stack
-                        + PAGE_SIZE-1) >> PAGE_SHIFT;
-
-       /*
-        * We store the registers in an order/format that is
-        * compatible with DEC Unix/OSF/1 as this makes life easier
-        * for gdb.
-        */
-       dump->regs[EF_V0]  = pt->r0;
-       dump->regs[EF_T0]  = pt->r1;
-       dump->regs[EF_T1]  = pt->r2;
-       dump->regs[EF_T2]  = pt->r3;
-       dump->regs[EF_T3]  = pt->r4;
-       dump->regs[EF_T4]  = pt->r5;
-       dump->regs[EF_T5]  = pt->r6;
-       dump->regs[EF_T6]  = pt->r7;
-       dump->regs[EF_T7]  = pt->r8;
-       dump->regs[EF_S0]  = sw->r9;
-       dump->regs[EF_S1]  = sw->r10;
-       dump->regs[EF_S2]  = sw->r11;
-       dump->regs[EF_S3]  = sw->r12;
-       dump->regs[EF_S4]  = sw->r13;
-       dump->regs[EF_S5]  = sw->r14;
-       dump->regs[EF_S6]  = sw->r15;
-       dump->regs[EF_A3]  = pt->r19;
-       dump->regs[EF_A4]  = pt->r20;
-       dump->regs[EF_A5]  = pt->r21;
-       dump->regs[EF_T8]  = pt->r22;
-       dump->regs[EF_T9]  = pt->r23;
-       dump->regs[EF_T10] = pt->r24;
-       dump->regs[EF_T11] = pt->r25;
-       dump->regs[EF_RA]  = pt->r26;
-       dump->regs[EF_T12] = pt->r27;
-       dump->regs[EF_AT]  = pt->r28;
-       dump->regs[EF_SP]  = rdusp();
-       dump->regs[EF_PS]  = pt->ps;
-       dump->regs[EF_PC]  = pt->pc;
-       dump->regs[EF_GP]  = pt->gp;
-       dump->regs[EF_A0]  = pt->r16;
-       dump->regs[EF_A1]  = pt->r17;
-       dump->regs[EF_A2]  = pt->r18;
-       memcpy((char *)dump->regs + EF_SIZE, sw->fp, 32 * 8);
-}
-
-#endif /* __KERNEL__ */
-#endif /* _ASM_A_OUT_CORE_H */
diff --git a/include/asm-alpha/a.out.h b/include/asm-alpha/a.out.h
deleted file mode 100644 (file)
index 02ce847..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-#ifndef __ALPHA_A_OUT_H__
-#define __ALPHA_A_OUT_H__
-
-#include <linux/types.h>
-
-/*
- * OSF/1 ECOFF header structs.  ECOFF files consist of:
- *     - a file header (struct filehdr),
- *     - an a.out header (struct aouthdr),
- *     - one or more section headers (struct scnhdr). 
- *       The filhdr's "f_nscns" field contains the
- *       number of section headers.
- */
-
-struct filehdr
-{
-       /* OSF/1 "file" header */
-       __u16 f_magic, f_nscns;
-       __u32 f_timdat;
-       __u64 f_symptr;
-       __u32 f_nsyms;
-       __u16 f_opthdr, f_flags;
-};
-
-struct aouthdr
-{
-       __u64 info;             /* after that it looks quite normal.. */
-       __u64 tsize;
-       __u64 dsize;
-       __u64 bsize;
-       __u64 entry;
-       __u64 text_start;       /* with a few additions that actually make sense */
-       __u64 data_start;
-       __u64 bss_start;
-       __u32 gprmask, fprmask; /* bitmask of general & floating point regs used in binary */
-       __u64 gpvalue;
-};
-
-struct scnhdr
-{
-       char    s_name[8];
-       __u64   s_paddr;
-       __u64   s_vaddr;
-       __u64   s_size;
-       __u64   s_scnptr;
-       __u64   s_relptr;
-       __u64   s_lnnoptr;
-       __u16   s_nreloc;
-       __u16   s_nlnno;
-       __u32   s_flags;
-};
-
-struct exec
-{
-       /* OSF/1 "file" header */
-       struct filehdr          fh;
-       struct aouthdr          ah;
-};
-
-/*
- * Define's so that the kernel exec code can access the a.out header
- * fields...
- */
-#define        a_info          ah.info
-#define        a_text          ah.tsize
-#define a_data         ah.dsize
-#define a_bss          ah.bsize
-#define a_entry                ah.entry
-#define a_textstart    ah.text_start
-#define        a_datastart     ah.data_start
-#define        a_bssstart      ah.bss_start
-#define        a_gprmask       ah.gprmask
-#define a_fprmask      ah.fprmask
-#define a_gpvalue      ah.gpvalue
-
-#define N_TXTADDR(x) ((x).a_textstart)
-#define N_DATADDR(x) ((x).a_datastart)
-#define N_BSSADDR(x) ((x).a_bssstart)
-#define N_DRSIZE(x) 0
-#define N_TRSIZE(x) 0
-#define N_SYMSIZE(x) 0
-
-#define AOUTHSZ                sizeof(struct aouthdr)
-#define SCNHSZ         sizeof(struct scnhdr)
-#define SCNROUND       16
-
-#define N_TXTOFF(x) \
-  ((long) N_MAGIC(x) == ZMAGIC ? 0 : \
-   (sizeof(struct exec) + (x).fh.f_nscns*SCNHSZ + SCNROUND - 1) & ~(SCNROUND - 1))
-
-#ifdef __KERNEL__
-
-/* Assume that start addresses below 4G belong to a TASO application.
-   Unfortunately, there is no proper bit in the exec header to check.
-   Worse, we have to notice the start address before swapping to use
-   /sbin/loader, which of course is _not_ a TASO application.  */
-#define SET_AOUT_PERSONALITY(BFPM, EX) \
-       set_personality (((BFPM->sh_bang || EX.ah.entry < 0x100000000L \
-                          ? ADDR_LIMIT_32BIT : 0) | PER_OSF4))
-
-#endif /* __KERNEL__ */
-#endif /* __A_OUT_GNU_H__ */
diff --git a/include/asm-alpha/agp.h b/include/asm-alpha/agp.h
deleted file mode 100644 (file)
index 26c1791..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef AGP_H
-#define AGP_H 1
-
-#include <asm/io.h>
-
-/* dummy for now */
-
-#define map_page_into_agp(page) 
-#define unmap_page_from_agp(page) 
-#define flush_agp_cache() mb()
-
-/* Convert a physical address to an address suitable for the GART. */
-#define phys_to_gart(x) (x)
-#define gart_to_phys(x) (x)
-
-/* GATT allocation. Returns/accepts GATT kernel virtual address. */
-#define alloc_gatt_pages(order)                \
-       ((char *)__get_free_pages(GFP_KERNEL, (order)))
-#define free_gatt_pages(table, order)  \
-       free_pages((unsigned long)(table), (order))
-
-#endif
diff --git a/include/asm-alpha/agp_backend.h b/include/asm-alpha/agp_backend.h
deleted file mode 100644 (file)
index 55dd44a..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef _ALPHA_AGP_BACKEND_H
-#define _ALPHA_AGP_BACKEND_H 1
-
-typedef        union _alpha_agp_mode {
-       struct {
-               u32 rate : 3;
-               u32 reserved0 : 1;
-               u32 fw : 1;
-               u32 fourgb : 1;
-               u32 reserved1 : 2;
-               u32 enable : 1;
-               u32 sba : 1;
-               u32 reserved2 : 14;
-               u32 rq : 8;
-       } bits;
-       u32 lw;
-} alpha_agp_mode;
-
-typedef struct _alpha_agp_info {
-       struct pci_controller *hose;
-       struct {
-               dma_addr_t bus_base;
-               unsigned long size;
-               void *sysdata;
-       } aperture;
-       alpha_agp_mode capability;
-       alpha_agp_mode mode;
-       void *private;
-       struct alpha_agp_ops *ops;
-} alpha_agp_info;
-
-struct alpha_agp_ops {
-       int (*setup)(alpha_agp_info *);
-       void (*cleanup)(alpha_agp_info *);
-       int (*configure)(alpha_agp_info *);
-       int (*bind)(alpha_agp_info *, off_t, struct agp_memory *);
-       int (*unbind)(alpha_agp_info *, off_t, struct agp_memory *);
-       unsigned long (*translate)(alpha_agp_info *, dma_addr_t);
-};
-
-
-#endif /* _ALPHA_AGP_BACKEND_H */
diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h
deleted file mode 100644 (file)
index ca88e54..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-#ifndef _ALPHA_ATOMIC_H
-#define _ALPHA_ATOMIC_H
-
-#include <asm/barrier.h>
-#include <asm/system.h>
-
-/*
- * Atomic operations that C can't guarantee us.  Useful for
- * resource counting etc...
- *
- * But use these as seldom as possible since they are much slower
- * than regular operations.
- */
-
-
-/*
- * Counter is volatile to make sure gcc doesn't try to be clever
- * and move things around on us. We need to use _exactly_ the address
- * the user gave us, not some alias that contains the same information.
- */
-typedef struct { volatile int counter; } atomic_t;
-typedef struct { volatile long counter; } atomic64_t;
-
-#define ATOMIC_INIT(i)         ( (atomic_t) { (i) } )
-#define ATOMIC64_INIT(i)       ( (atomic64_t) { (i) } )
-
-#define atomic_read(v)         ((v)->counter + 0)
-#define atomic64_read(v)       ((v)->counter + 0)
-
-#define atomic_set(v,i)                ((v)->counter = (i))
-#define atomic64_set(v,i)      ((v)->counter = (i))
-
-/*
- * To get proper branch prediction for the main line, we must branch
- * forward to code at the end of this object's .text section, then
- * branch back to restart the operation.
- */
-
-static __inline__ void atomic_add(int i, atomic_t * v)
-{
-       unsigned long temp;
-       __asm__ __volatile__(
-       "1:     ldl_l %0,%1\n"
-       "       addl %0,%2,%0\n"
-       "       stl_c %0,%1\n"
-       "       beq %0,2f\n"
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (v->counter)
-       :"Ir" (i), "m" (v->counter));
-}
-
-static __inline__ void atomic64_add(long i, atomic64_t * v)
-{
-       unsigned long temp;
-       __asm__ __volatile__(
-       "1:     ldq_l %0,%1\n"
-       "       addq %0,%2,%0\n"
-       "       stq_c %0,%1\n"
-       "       beq %0,2f\n"
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (v->counter)
-       :"Ir" (i), "m" (v->counter));
-}
-
-static __inline__ void atomic_sub(int i, atomic_t * v)
-{
-       unsigned long temp;
-       __asm__ __volatile__(
-       "1:     ldl_l %0,%1\n"
-       "       subl %0,%2,%0\n"
-       "       stl_c %0,%1\n"
-       "       beq %0,2f\n"
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (v->counter)
-       :"Ir" (i), "m" (v->counter));
-}
-
-static __inline__ void atomic64_sub(long i, atomic64_t * v)
-{
-       unsigned long temp;
-       __asm__ __volatile__(
-       "1:     ldq_l %0,%1\n"
-       "       subq %0,%2,%0\n"
-       "       stq_c %0,%1\n"
-       "       beq %0,2f\n"
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (v->counter)
-       :"Ir" (i), "m" (v->counter));
-}
-
-
-/*
- * Same as above, but return the result value
- */
-static inline int atomic_add_return(int i, atomic_t *v)
-{
-       long temp, result;
-       smp_mb();
-       __asm__ __volatile__(
-       "1:     ldl_l %0,%1\n"
-       "       addl %0,%3,%2\n"
-       "       addl %0,%3,%0\n"
-       "       stl_c %0,%1\n"
-       "       beq %0,2f\n"
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (v->counter), "=&r" (result)
-       :"Ir" (i), "m" (v->counter) : "memory");
-       smp_mb();
-       return result;
-}
-
-static __inline__ long atomic64_add_return(long i, atomic64_t * v)
-{
-       long temp, result;
-       smp_mb();
-       __asm__ __volatile__(
-       "1:     ldq_l %0,%1\n"
-       "       addq %0,%3,%2\n"
-       "       addq %0,%3,%0\n"
-       "       stq_c %0,%1\n"
-       "       beq %0,2f\n"
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (v->counter), "=&r" (result)
-       :"Ir" (i), "m" (v->counter) : "memory");
-       smp_mb();
-       return result;
-}
-
-static __inline__ long atomic_sub_return(int i, atomic_t * v)
-{
-       long temp, result;
-       smp_mb();
-       __asm__ __volatile__(
-       "1:     ldl_l %0,%1\n"
-       "       subl %0,%3,%2\n"
-       "       subl %0,%3,%0\n"
-       "       stl_c %0,%1\n"
-       "       beq %0,2f\n"
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (v->counter), "=&r" (result)
-       :"Ir" (i), "m" (v->counter) : "memory");
-       smp_mb();
-       return result;
-}
-
-static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
-{
-       long temp, result;
-       smp_mb();
-       __asm__ __volatile__(
-       "1:     ldq_l %0,%1\n"
-       "       subq %0,%3,%2\n"
-       "       subq %0,%3,%0\n"
-       "       stq_c %0,%1\n"
-       "       beq %0,2f\n"
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (v->counter), "=&r" (result)
-       :"Ir" (i), "m" (v->counter) : "memory");
-       smp_mb();
-       return result;
-}
-
-#define atomic64_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
-#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
-
-#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new))
-#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
-
-/**
- * atomic_add_unless - add unless the number is a given value
- * @v: pointer of type atomic_t
- * @a: the amount to add to v...
- * @u: ...unless v is equal to u.
- *
- * Atomically adds @a to @v, so long as it was not @u.
- * Returns non-zero if @v was not @u, and zero otherwise.
- */
-static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
-{
-       int c, old;
-       c = atomic_read(v);
-       for (;;) {
-               if (unlikely(c == (u)))
-                       break;
-               old = atomic_cmpxchg((v), c, c + (a));
-               if (likely(old == c))
-                       break;
-               c = old;
-       }
-       return c != (u);
-}
-
-#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
-
-/**
- * atomic64_add_unless - add unless the number is a given value
- * @v: pointer of type atomic64_t
- * @a: the amount to add to v...
- * @u: ...unless v is equal to u.
- *
- * Atomically adds @a to @v, so long as it was not @u.
- * Returns non-zero if @v was not @u, and zero otherwise.
- */
-static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
-{
-       long c, old;
-       c = atomic64_read(v);
-       for (;;) {
-               if (unlikely(c == (u)))
-                       break;
-               old = atomic64_cmpxchg((v), c, c + (a));
-               if (likely(old == c))
-                       break;
-               c = old;
-       }
-       return c != (u);
-}
-
-#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
-
-#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
-#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0)
-
-#define atomic_dec_return(v) atomic_sub_return(1,(v))
-#define atomic64_dec_return(v) atomic64_sub_return(1,(v))
-
-#define atomic_inc_return(v) atomic_add_return(1,(v))
-#define atomic64_inc_return(v) atomic64_add_return(1,(v))
-
-#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)
-#define atomic64_sub_and_test(i,v) (atomic64_sub_return((i), (v)) == 0)
-
-#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0)
-#define atomic64_inc_and_test(v) (atomic64_add_return(1, (v)) == 0)
-
-#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
-#define atomic64_dec_and_test(v) (atomic64_sub_return(1, (v)) == 0)
-
-#define atomic_inc(v) atomic_add(1,(v))
-#define atomic64_inc(v) atomic64_add(1,(v))
-
-#define atomic_dec(v) atomic_sub(1,(v))
-#define atomic64_dec(v) atomic64_sub(1,(v))
-
-#define smp_mb__before_atomic_dec()    smp_mb()
-#define smp_mb__after_atomic_dec()     smp_mb()
-#define smp_mb__before_atomic_inc()    smp_mb()
-#define smp_mb__after_atomic_inc()     smp_mb()
-
-#include <asm-generic/atomic.h>
-#endif /* _ALPHA_ATOMIC_H */
diff --git a/include/asm-alpha/auxvec.h b/include/asm-alpha/auxvec.h
deleted file mode 100644 (file)
index e96fe88..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __ASM_ALPHA_AUXVEC_H
-#define __ASM_ALPHA_AUXVEC_H
-
-/* Reserve these numbers for any future use of a VDSO.  */
-#if 0
-#define AT_SYSINFO             32
-#define AT_SYSINFO_EHDR                33
-#endif
-
-/* More complete cache descriptions than AT_[DIU]CACHEBSIZE.  If the
-   value is -1, then the cache doesn't exist.  Otherwise:
-
-      bit 0-3:   Cache set-associativity; 0 means fully associative.
-      bit 4-7:   Log2 of cacheline size.
-      bit 8-31:          Size of the entire cache >> 8.
-      bit 32-63:  Reserved.
-*/
-
-#define AT_L1I_CACHESHAPE      34
-#define AT_L1D_CACHESHAPE      35
-#define AT_L2_CACHESHAPE       36
-#define AT_L3_CACHESHAPE       37
-
-#endif /* __ASM_ALPHA_AUXVEC_H */
diff --git a/include/asm-alpha/barrier.h b/include/asm-alpha/barrier.h
deleted file mode 100644 (file)
index ac78eba..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef __BARRIER_H
-#define __BARRIER_H
-
-#include <asm/compiler.h>
-
-#define mb() \
-__asm__ __volatile__("mb": : :"memory")
-
-#define rmb() \
-__asm__ __volatile__("mb": : :"memory")
-
-#define wmb() \
-__asm__ __volatile__("wmb": : :"memory")
-
-#define read_barrier_depends() \
-__asm__ __volatile__("mb": : :"memory")
-
-#ifdef CONFIG_SMP
-#define smp_mb()       mb()
-#define smp_rmb()      rmb()
-#define smp_wmb()      wmb()
-#define smp_read_barrier_depends()     read_barrier_depends()
-#else
-#define smp_mb()       barrier()
-#define smp_rmb()      barrier()
-#define smp_wmb()      barrier()
-#define smp_read_barrier_depends()     do { } while (0)
-#endif
-
-#define set_mb(var, value) \
-do { var = value; mb(); } while (0)
-
-#endif         /* __BARRIER_H */
diff --git a/include/asm-alpha/bitops.h b/include/asm-alpha/bitops.h
deleted file mode 100644 (file)
index 15f3ae2..0000000
+++ /dev/null
@@ -1,466 +0,0 @@
-#ifndef _ALPHA_BITOPS_H
-#define _ALPHA_BITOPS_H
-
-#ifndef _LINUX_BITOPS_H
-#error only <linux/bitops.h> can be included directly
-#endif
-
-#include <asm/compiler.h>
-#include <asm/barrier.h>
-
-/*
- * Copyright 1994, Linus Torvalds.
- */
-
-/*
- * These have to be done with inline assembly: that way the bit-setting
- * is guaranteed to be atomic. All bit operations return 0 if the bit
- * was cleared before the operation and != 0 if it was not.
- *
- * To get proper branch prediction for the main line, we must branch
- * forward to code at the end of this object's .text section, then
- * branch back to restart the operation.
- *
- * bit 0 is the LSB of addr; bit 64 is the LSB of (addr+1).
- */
-
-static inline void
-set_bit(unsigned long nr, volatile void * addr)
-{
-       unsigned long temp;
-       int *m = ((int *) addr) + (nr >> 5);
-
-       __asm__ __volatile__(
-       "1:     ldl_l %0,%3\n"
-       "       bis %0,%2,%0\n"
-       "       stl_c %0,%1\n"
-       "       beq %0,2f\n"
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (*m)
-       :"Ir" (1UL << (nr & 31)), "m" (*m));
-}
-
-/*
- * WARNING: non atomic version.
- */
-static inline void
-__set_bit(unsigned long nr, volatile void * addr)
-{
-       int *m = ((int *) addr) + (nr >> 5);
-
-       *m |= 1 << (nr & 31);
-}
-
-#define smp_mb__before_clear_bit()     smp_mb()
-#define smp_mb__after_clear_bit()      smp_mb()
-
-static inline void
-clear_bit(unsigned long nr, volatile void * addr)
-{
-       unsigned long temp;
-       int *m = ((int *) addr) + (nr >> 5);
-
-       __asm__ __volatile__(
-       "1:     ldl_l %0,%3\n"
-       "       bic %0,%2,%0\n"
-       "       stl_c %0,%1\n"
-       "       beq %0,2f\n"
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (*m)
-       :"Ir" (1UL << (nr & 31)), "m" (*m));
-}
-
-static inline void
-clear_bit_unlock(unsigned long nr, volatile void * addr)
-{
-       smp_mb();
-       clear_bit(nr, addr);
-}
-
-/*
- * WARNING: non atomic version.
- */
-static __inline__ void
-__clear_bit(unsigned long nr, volatile void * addr)
-{
-       int *m = ((int *) addr) + (nr >> 5);
-
-       *m &= ~(1 << (nr & 31));
-}
-
-static inline void
-__clear_bit_unlock(unsigned long nr, volatile void * addr)
-{
-       smp_mb();
-       __clear_bit(nr, addr);
-}
-
-static inline void
-change_bit(unsigned long nr, volatile void * addr)
-{
-       unsigned long temp;
-       int *m = ((int *) addr) + (nr >> 5);
-
-       __asm__ __volatile__(
-       "1:     ldl_l %0,%3\n"
-       "       xor %0,%2,%0\n"
-       "       stl_c %0,%1\n"
-       "       beq %0,2f\n"
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (*m)
-       :"Ir" (1UL << (nr & 31)), "m" (*m));
-}
-
-/*
- * WARNING: non atomic version.
- */
-static __inline__ void
-__change_bit(unsigned long nr, volatile void * addr)
-{
-       int *m = ((int *) addr) + (nr >> 5);
-
-       *m ^= 1 << (nr & 31);
-}
-
-static inline int
-test_and_set_bit(unsigned long nr, volatile void *addr)
-{
-       unsigned long oldbit;
-       unsigned long temp;
-       int *m = ((int *) addr) + (nr >> 5);
-
-       __asm__ __volatile__(
-#ifdef CONFIG_SMP
-       "       mb\n"
-#endif
-       "1:     ldl_l %0,%4\n"
-       "       and %0,%3,%2\n"
-       "       bne %2,2f\n"
-       "       xor %0,%3,%0\n"
-       "       stl_c %0,%1\n"
-       "       beq %0,3f\n"
-       "2:\n"
-#ifdef CONFIG_SMP
-       "       mb\n"
-#endif
-       ".subsection 2\n"
-       "3:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (*m), "=&r" (oldbit)
-       :"Ir" (1UL << (nr & 31)), "m" (*m) : "memory");
-
-       return oldbit != 0;
-}
-
-static inline int
-test_and_set_bit_lock(unsigned long nr, volatile void *addr)
-{
-       unsigned long oldbit;
-       unsigned long temp;
-       int *m = ((int *) addr) + (nr >> 5);
-
-       __asm__ __volatile__(
-       "1:     ldl_l %0,%4\n"
-       "       and %0,%3,%2\n"
-       "       bne %2,2f\n"
-       "       xor %0,%3,%0\n"
-       "       stl_c %0,%1\n"
-       "       beq %0,3f\n"
-       "2:\n"
-#ifdef CONFIG_SMP
-       "       mb\n"
-#endif
-       ".subsection 2\n"
-       "3:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (*m), "=&r" (oldbit)
-       :"Ir" (1UL << (nr & 31)), "m" (*m) : "memory");
-
-       return oldbit != 0;
-}
-
-/*
- * WARNING: non atomic version.
- */
-static inline int
-__test_and_set_bit(unsigned long nr, volatile void * addr)
-{
-       unsigned long mask = 1 << (nr & 0x1f);
-       int *m = ((int *) addr) + (nr >> 5);
-       int old = *m;
-
-       *m = old | mask;
-       return (old & mask) != 0;
-}
-
-static inline int
-test_and_clear_bit(unsigned long nr, volatile void * addr)
-{
-       unsigned long oldbit;
-       unsigned long temp;
-       int *m = ((int *) addr) + (nr >> 5);
-
-       __asm__ __volatile__(
-#ifdef CONFIG_SMP
-       "       mb\n"
-#endif
-       "1:     ldl_l %0,%4\n"
-       "       and %0,%3,%2\n"
-       "       beq %2,2f\n"
-       "       xor %0,%3,%0\n"
-       "       stl_c %0,%1\n"
-       "       beq %0,3f\n"
-       "2:\n"
-#ifdef CONFIG_SMP
-       "       mb\n"
-#endif
-       ".subsection 2\n"
-       "3:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (*m), "=&r" (oldbit)
-       :"Ir" (1UL << (nr & 31)), "m" (*m) : "memory");
-
-       return oldbit != 0;
-}
-
-/*
- * WARNING: non atomic version.
- */
-static inline int
-__test_and_clear_bit(unsigned long nr, volatile void * addr)
-{
-       unsigned long mask = 1 << (nr & 0x1f);
-       int *m = ((int *) addr) + (nr >> 5);
-       int old = *m;
-
-       *m = old & ~mask;
-       return (old & mask) != 0;
-}
-
-static inline int
-test_and_change_bit(unsigned long nr, volatile void * addr)
-{
-       unsigned long oldbit;
-       unsigned long temp;
-       int *m = ((int *) addr) + (nr >> 5);
-
-       __asm__ __volatile__(
-#ifdef CONFIG_SMP
-       "       mb\n"
-#endif
-       "1:     ldl_l %0,%4\n"
-       "       and %0,%3,%2\n"
-       "       xor %0,%3,%0\n"
-       "       stl_c %0,%1\n"
-       "       beq %0,3f\n"
-#ifdef CONFIG_SMP
-       "       mb\n"
-#endif
-       ".subsection 2\n"
-       "3:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (*m), "=&r" (oldbit)
-       :"Ir" (1UL << (nr & 31)), "m" (*m) : "memory");
-
-       return oldbit != 0;
-}
-
-/*
- * WARNING: non atomic version.
- */
-static __inline__ int
-__test_and_change_bit(unsigned long nr, volatile void * addr)
-{
-       unsigned long mask = 1 << (nr & 0x1f);
-       int *m = ((int *) addr) + (nr >> 5);
-       int old = *m;
-
-       *m = old ^ mask;
-       return (old & mask) != 0;
-}
-
-static inline int
-test_bit(int nr, const volatile void * addr)
-{
-       return (1UL & (((const int *) addr)[nr >> 5] >> (nr & 31))) != 0UL;
-}
-
-/*
- * ffz = Find First Zero in word. Undefined if no zero exists,
- * so code should check against ~0UL first..
- *
- * Do a binary search on the bits.  Due to the nature of large
- * constants on the alpha, it is worthwhile to split the search.
- */
-static inline unsigned long ffz_b(unsigned long x)
-{
-       unsigned long sum, x1, x2, x4;
-
-       x = ~x & -~x;           /* set first 0 bit, clear others */
-       x1 = x & 0xAA;
-       x2 = x & 0xCC;
-       x4 = x & 0xF0;
-       sum = x2 ? 2 : 0;
-       sum += (x4 != 0) * 4;
-       sum += (x1 != 0);
-
-       return sum;
-}
-
-static inline unsigned long ffz(unsigned long word)
-{
-#if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67)
-       /* Whee.  EV67 can calculate it directly.  */
-       return __kernel_cttz(~word);
-#else
-       unsigned long bits, qofs, bofs;
-
-       bits = __kernel_cmpbge(word, ~0UL);
-       qofs = ffz_b(bits);
-       bits = __kernel_extbl(word, qofs);
-       bofs = ffz_b(bits);
-
-       return qofs*8 + bofs;
-#endif
-}
-
-/*
- * __ffs = Find First set bit in word.  Undefined if no set bit exists.
- */
-static inline unsigned long __ffs(unsigned long word)
-{
-#if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67)
-       /* Whee.  EV67 can calculate it directly.  */
-       return __kernel_cttz(word);
-#else
-       unsigned long bits, qofs, bofs;
-
-       bits = __kernel_cmpbge(0, word);
-       qofs = ffz_b(bits);
-       bits = __kernel_extbl(word, qofs);
-       bofs = ffz_b(~bits);
-
-       return qofs*8 + bofs;
-#endif
-}
-
-#ifdef __KERNEL__
-
-/*
- * ffs: find first bit set. This is defined the same way as
- * the libc and compiler builtin ffs routines, therefore
- * differs in spirit from the above __ffs.
- */
-
-static inline int ffs(int word)
-{
-       int result = __ffs(word) + 1;
-       return word ? result : 0;
-}
-
-/*
- * fls: find last bit set.
- */
-#if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67)
-static inline int fls64(unsigned long word)
-{
-       return 64 - __kernel_ctlz(word);
-}
-#else
-extern const unsigned char __flsm1_tab[256];
-
-static inline int fls64(unsigned long x)
-{
-       unsigned long t, a, r;
-
-       t = __kernel_cmpbge (x, 0x0101010101010101UL);
-       a = __flsm1_tab[t];
-       t = __kernel_extbl (x, a);
-       r = a*8 + __flsm1_tab[t] + (x != 0);
-
-       return r;
-}
-#endif
-
-static inline unsigned long __fls(unsigned long x)
-{
-       return fls64(x) - 1;
-}
-
-static inline int fls(int x)
-{
-       return fls64((unsigned int) x);
-}
-
-/*
- * hweightN: returns the hamming weight (i.e. the number
- * of bits set) of a N-bit word
- */
-
-#if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67)
-/* Whee.  EV67 can calculate it directly.  */
-static inline unsigned long hweight64(unsigned long w)
-{
-       return __kernel_ctpop(w);
-}
-
-static inline unsigned int hweight32(unsigned int w)
-{
-       return hweight64(w);
-}
-
-static inline unsigned int hweight16(unsigned int w)
-{
-       return hweight64(w & 0xffff);
-}
-
-static inline unsigned int hweight8(unsigned int w)
-{
-       return hweight64(w & 0xff);
-}
-#else
-#include <asm-generic/bitops/hweight.h>
-#endif
-
-#endif /* __KERNEL__ */
-
-#include <asm-generic/bitops/find.h>
-
-#ifdef __KERNEL__
-
-/*
- * Every architecture must define this function. It's the fastest
- * way of searching a 140-bit bitmap where the first 100 bits are
- * unlikely to be set. It's guaranteed that at least one of the 140
- * bits is set.
- */
-static inline unsigned long
-sched_find_first_bit(unsigned long b[3])
-{
-       unsigned long b0 = b[0], b1 = b[1], b2 = b[2];
-       unsigned long ofs;
-
-       ofs = (b1 ? 64 : 128);
-       b1 = (b1 ? b1 : b2);
-       ofs = (b0 ? 0 : ofs);
-       b0 = (b0 ? b0 : b1);
-
-       return __ffs(b0) + ofs;
-}
-
-#include <asm-generic/bitops/ext2-non-atomic.h>
-
-#define ext2_set_bit_atomic(l,n,a)   test_and_set_bit(n,a)
-#define ext2_clear_bit_atomic(l,n,a) test_and_clear_bit(n,a)
-
-#include <asm-generic/bitops/minix.h>
-
-#endif /* __KERNEL__ */
-
-#endif /* _ALPHA_BITOPS_H */
diff --git a/include/asm-alpha/bug.h b/include/asm-alpha/bug.h
deleted file mode 100644 (file)
index 695a5ee..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _ALPHA_BUG_H
-#define _ALPHA_BUG_H
-
-#include <linux/linkage.h>
-
-#ifdef CONFIG_BUG
-#include <asm/pal.h>
-
-/* ??? Would be nice to use .gprel32 here, but we can't be sure that the
-   function loaded the GP, so this could fail in modules.  */
-static inline void ATTRIB_NORET __BUG(const char *file, int line)
-{
-       __asm__ __volatile__(
-               "call_pal %0  # bugchk\n\t"
-               ".long %1\n\t.8byte %2"
-                      : : "i" (PAL_bugchk), "i"(line), "i"(file));
-       for ( ; ; )
-               ;
-}
-
-#define BUG() __BUG(__FILE__, __LINE__)
-
-#define HAVE_ARCH_BUG
-#endif
-
-#include <asm-generic/bug.h>
-
-#endif
diff --git a/include/asm-alpha/bugs.h b/include/asm-alpha/bugs.h
deleted file mode 100644 (file)
index 78030d1..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- *  include/asm-alpha/bugs.h
- *
- *  Copyright (C) 1994  Linus Torvalds
- */
-
-/*
- * This is included by init/main.c to check for architecture-dependent bugs.
- *
- * Needs:
- *     void check_bugs(void);
- */
-
-/*
- * I don't know of any alpha bugs yet.. Nice chip
- */
-
-static void check_bugs(void)
-{
-}
diff --git a/include/asm-alpha/byteorder.h b/include/asm-alpha/byteorder.h
deleted file mode 100644 (file)
index 58e958f..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef _ALPHA_BYTEORDER_H
-#define _ALPHA_BYTEORDER_H
-
-#include <asm/types.h>
-#include <linux/compiler.h>
-#include <asm/compiler.h>
-
-#ifdef __GNUC__
-
-static inline __attribute_const__ __u32 __arch__swab32(__u32 x)
-{
-       /*
-        * Unfortunately, we can't use the 6 instruction sequence
-        * on ev6 since the latency of the UNPKBW is 3, which is
-        * pretty hard to hide.  Just in case a future implementation
-        * has a lower latency, here's the sequence (also by Mike Burrows)
-        *
-        * UNPKBW a0, v0       v0: 00AA00BB00CC00DD
-        * SLL v0, 24, a0      a0: BB00CC00DD000000
-        * BIS v0, a0, a0      a0: BBAACCBBDDCC00DD
-        * EXTWL a0, 6, v0     v0: 000000000000BBAA
-        * ZAP a0, 0xf3, a0    a0: 00000000DDCC0000
-        * ADDL a0, v0, v0     v0: ssssssssDDCCBBAA
-        */
-
-       __u64 t0, t1, t2, t3;
-
-       t0 = __kernel_inslh(x, 7);      /* t0 : 0000000000AABBCC */
-       t1 = __kernel_inswl(x, 3);      /* t1 : 000000CCDD000000 */
-       t1 |= t0;                       /* t1 : 000000CCDDAABBCC */
-       t2 = t1 >> 16;                  /* t2 : 0000000000CCDDAA */
-       t0 = t1 & 0xFF00FF00;           /* t0 : 00000000DD00BB00 */
-       t3 = t2 & 0x00FF00FF;           /* t3 : 0000000000CC00AA */
-       t1 = t0 + t3;                   /* t1 : ssssssssDDCCBBAA */
-
-       return t1;
-}
-
-#define __arch__swab32 __arch__swab32
-
-#endif /* __GNUC__ */
-
-#define __BYTEORDER_HAS_U64__
-
-#include <linux/byteorder/little_endian.h>
-
-#endif /* _ALPHA_BYTEORDER_H */
diff --git a/include/asm-alpha/cache.h b/include/asm-alpha/cache.h
deleted file mode 100644 (file)
index f199e69..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * include/asm-alpha/cache.h
- */
-#ifndef __ARCH_ALPHA_CACHE_H
-#define __ARCH_ALPHA_CACHE_H
-
-
-/* Bytes per L1 (data) cache line. */
-#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_EV6)
-# define L1_CACHE_BYTES     64
-# define L1_CACHE_SHIFT     6
-#else
-/* Both EV4 and EV5 are write-through, read-allocate,
-   direct-mapped, physical.
-*/
-# define L1_CACHE_BYTES     32
-# define L1_CACHE_SHIFT     5
-#endif
-
-#define L1_CACHE_ALIGN(x)  (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
-#define SMP_CACHE_BYTES    L1_CACHE_BYTES
-
-#endif
diff --git a/include/asm-alpha/cacheflush.h b/include/asm-alpha/cacheflush.h
deleted file mode 100644 (file)
index b686cc7..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#ifndef _ALPHA_CACHEFLUSH_H
-#define _ALPHA_CACHEFLUSH_H
-
-#include <linux/mm.h>
-
-/* Caches aren't brain-dead on the Alpha. */
-#define flush_cache_all()                      do { } while (0)
-#define flush_cache_mm(mm)                     do { } while (0)
-#define flush_cache_dup_mm(mm)                 do { } while (0)
-#define flush_cache_range(vma, start, end)     do { } while (0)
-#define flush_cache_page(vma, vmaddr, pfn)     do { } while (0)
-#define flush_dcache_page(page)                        do { } while (0)
-#define flush_dcache_mmap_lock(mapping)                do { } while (0)
-#define flush_dcache_mmap_unlock(mapping)      do { } while (0)
-#define flush_cache_vmap(start, end)           do { } while (0)
-#define flush_cache_vunmap(start, end)         do { } while (0)
-
-/* Note that the following two definitions are _highly_ dependent
-   on the contexts in which they are used in the kernel.  I personally
-   think it is criminal how loosely defined these macros are.  */
-
-/* We need to flush the kernel's icache after loading modules.  The
-   only other use of this macro is in load_aout_interp which is not
-   used on Alpha. 
-
-   Note that this definition should *not* be used for userspace
-   icache flushing.  While functional, it is _way_ overkill.  The
-   icache is tagged with ASNs and it suffices to allocate a new ASN
-   for the process.  */
-#ifndef CONFIG_SMP
-#define flush_icache_range(start, end)         imb()
-#else
-#define flush_icache_range(start, end)         smp_imb()
-extern void smp_imb(void);
-#endif
-
-/* We need to flush the userspace icache after setting breakpoints in
-   ptrace.
-
-   Instead of indiscriminately using imb, take advantage of the fact
-   that icache entries are tagged with the ASN and load a new mm context.  */
-/* ??? Ought to use this in arch/alpha/kernel/signal.c too.  */
-
-#ifndef CONFIG_SMP
-extern void __load_new_mm_context(struct mm_struct *);
-static inline void
-flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
-                       unsigned long addr, int len)
-{
-       if (vma->vm_flags & VM_EXEC) {
-               struct mm_struct *mm = vma->vm_mm;
-               if (current->active_mm == mm)
-                       __load_new_mm_context(mm);
-               else
-                       mm->context[smp_processor_id()] = 0;
-       }
-}
-#else
-extern void flush_icache_user_range(struct vm_area_struct *vma,
-               struct page *page, unsigned long addr, int len);
-#endif
-
-/* This is used only in do_no_page and do_swap_page.  */
-#define flush_icache_page(vma, page) \
-  flush_icache_user_range((vma), (page), 0, 0)
-
-#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
-do { memcpy(dst, src, len); \
-     flush_icache_user_range(vma, page, vaddr, len); \
-} while (0)
-#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
-       memcpy(dst, src, len)
-
-#endif /* _ALPHA_CACHEFLUSH_H */
diff --git a/include/asm-alpha/checksum.h b/include/asm-alpha/checksum.h
deleted file mode 100644 (file)
index d3854bb..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef _ALPHA_CHECKSUM_H
-#define _ALPHA_CHECKSUM_H
-
-#include <linux/in6.h>
-
-/*
- *     This is a version of ip_compute_csum() optimized for IP headers,
- *     which always checksum on 4 octet boundaries.
- */
-extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
-
-/*
- * computes the checksum of the TCP/UDP pseudo-header
- * returns a 16-bit checksum, already complemented
- */
-extern __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
-                                          unsigned short len,
-                                          unsigned short proto,
-                                          __wsum sum);
-
-__wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
-                               unsigned short len, unsigned short proto,
-                               __wsum sum);
-
-/*
- * computes the checksum of a memory block at buff, length len,
- * and adds in "sum" (32-bit)
- *
- * returns a 32-bit number suitable for feeding into itself
- * or csum_tcpudp_magic
- *
- * this function must be called with even lengths, except
- * for the last fragment, which may be odd
- *
- * it's best to have buff aligned on a 32-bit boundary
- */
-extern __wsum csum_partial(const void *buff, int len, __wsum sum);
-
-/*
- * the same as csum_partial, but copies from src while it
- * checksums
- *
- * here even more important to align src and dst on a 32-bit (or even
- * better 64-bit) boundary
- */
-__wsum csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *errp);
-
-__wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
-
-
-/*
- * this routine is used for miscellaneous IP-like checksums, mainly
- * in icmp.c
- */
-
-extern __sum16 ip_compute_csum(const void *buff, int len);
-
-/*
- *     Fold a partial checksum without adding pseudo headers
- */
-
-static inline __sum16 csum_fold(__wsum csum)
-{
-       u32 sum = (__force u32)csum;
-       sum = (sum & 0xffff) + (sum >> 16);
-       sum = (sum & 0xffff) + (sum >> 16);
-       return (__force __sum16)~sum;
-}
-
-#define _HAVE_ARCH_IPV6_CSUM
-extern __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
-                              const struct in6_addr *daddr,
-                              __u32 len, unsigned short proto,
-                              __wsum sum);
-#endif
diff --git a/include/asm-alpha/compiler.h b/include/asm-alpha/compiler.h
deleted file mode 100644 (file)
index da6bb19..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-#ifndef __ALPHA_COMPILER_H
-#define __ALPHA_COMPILER_H
-
-/* 
- * Herein are macros we use when describing various patterns we want to GCC.
- * In all cases we can get better schedules out of the compiler if we hide
- * as little as possible inside inline assembly.  However, we want to be
- * able to know what we'll get out before giving up inline assembly.  Thus
- * these tests and macros.
- */
-
-#if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3
-# define __kernel_insbl(val, shift)    __builtin_alpha_insbl(val, shift)
-# define __kernel_inswl(val, shift)    __builtin_alpha_inswl(val, shift)
-# define __kernel_insql(val, shift)    __builtin_alpha_insql(val, shift)
-# define __kernel_inslh(val, shift)    __builtin_alpha_inslh(val, shift)
-# define __kernel_extbl(val, shift)    __builtin_alpha_extbl(val, shift)
-# define __kernel_extwl(val, shift)    __builtin_alpha_extwl(val, shift)
-# define __kernel_cmpbge(a, b)         __builtin_alpha_cmpbge(a, b)
-#else
-# define __kernel_insbl(val, shift)                                    \
-  ({ unsigned long __kir;                                              \
-     __asm__("insbl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));  \
-     __kir; })
-# define __kernel_inswl(val, shift)                                    \
-  ({ unsigned long __kir;                                              \
-     __asm__("inswl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));  \
-     __kir; })
-# define __kernel_insql(val, shift)                                    \
-  ({ unsigned long __kir;                                              \
-     __asm__("insql %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));  \
-     __kir; })
-# define __kernel_inslh(val, shift)                                    \
-  ({ unsigned long __kir;                                              \
-     __asm__("inslh %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));  \
-     __kir; })
-# define __kernel_extbl(val, shift)                                    \
-  ({ unsigned long __kir;                                              \
-     __asm__("extbl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));  \
-     __kir; })
-# define __kernel_extwl(val, shift)                                    \
-  ({ unsigned long __kir;                                              \
-     __asm__("extwl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));  \
-     __kir; })
-# define __kernel_cmpbge(a, b)                                         \
-  ({ unsigned long __kir;                                              \
-     __asm__("cmpbge %r2,%1,%0" : "=r"(__kir) : "rI"(b), "rJ"(a));     \
-     __kir; })
-#endif
-
-#ifdef __alpha_cix__
-# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3
-#  define __kernel_cttz(x)             __builtin_ctzl(x)
-#  define __kernel_ctlz(x)             __builtin_clzl(x)
-#  define __kernel_ctpop(x)            __builtin_popcountl(x)
-# else
-#  define __kernel_cttz(x)                                             \
-   ({ unsigned long __kir;                                             \
-      __asm__("cttz %1,%0" : "=r"(__kir) : "r"(x));                    \
-      __kir; })
-#  define __kernel_ctlz(x)                                             \
-   ({ unsigned long __kir;                                             \
-      __asm__("ctlz %1,%0" : "=r"(__kir) : "r"(x));                    \
-      __kir; })
-#  define __kernel_ctpop(x)                                            \
-   ({ unsigned long __kir;                                             \
-      __asm__("ctpop %1,%0" : "=r"(__kir) : "r"(x));                   \
-      __kir; })
-# endif
-#else
-# define __kernel_cttz(x)                                              \
-  ({ unsigned long __kir;                                              \
-     __asm__(".arch ev67; cttz %1,%0" : "=r"(__kir) : "r"(x));         \
-     __kir; })
-# define __kernel_ctlz(x)                                              \
-  ({ unsigned long __kir;                                              \
-     __asm__(".arch ev67; ctlz %1,%0" : "=r"(__kir) : "r"(x));         \
-     __kir; })
-# define __kernel_ctpop(x)                                             \
-  ({ unsigned long __kir;                                              \
-     __asm__(".arch ev67; ctpop %1,%0" : "=r"(__kir) : "r"(x));                \
-     __kir; })
-#endif
-
-
-/* 
- * Beginning with EGCS 1.1, GCC defines __alpha_bwx__ when the BWX 
- * extension is enabled.  Previous versions did not define anything
- * we could test during compilation -- too bad, so sad.
- */
-
-#if defined(__alpha_bwx__)
-#define __kernel_ldbu(mem)     (mem)
-#define __kernel_ldwu(mem)     (mem)
-#define __kernel_stb(val,mem)  ((mem) = (val))
-#define __kernel_stw(val,mem)  ((mem) = (val))
-#else
-#define __kernel_ldbu(mem)                             \
-  ({ unsigned char __kir;                              \
-     __asm__(".arch ev56;                              \
-             ldbu %0,%1" : "=r"(__kir) : "m"(mem));    \
-     __kir; })
-#define __kernel_ldwu(mem)                             \
-  ({ unsigned short __kir;                             \
-     __asm__(".arch ev56;                              \
-             ldwu %0,%1" : "=r"(__kir) : "m"(mem));    \
-     __kir; })
-#define __kernel_stb(val,mem)                          \
-  __asm__(".arch ev56;                                 \
-          stb %1,%0" : "=m"(mem) : "r"(val))
-#define __kernel_stw(val,mem)                          \
-  __asm__(".arch ev56;                                 \
-          stw %1,%0" : "=m"(mem) : "r"(val))
-#endif
-
-#ifdef __KERNEL__
-/* Some idiots over in <linux/compiler.h> thought inline should imply
-   always_inline.  This breaks stuff.  We'll include this file whenever
-   we run into such problems.  */
-
-#include <linux/compiler.h>
-#undef inline
-#undef __inline__
-#undef __inline
-#undef __always_inline
-#define __always_inline                inline __attribute__((always_inline))
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_COMPILER_H */
diff --git a/include/asm-alpha/console.h b/include/asm-alpha/console.h
deleted file mode 100644 (file)
index a3ce4e6..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef __AXP_CONSOLE_H
-#define __AXP_CONSOLE_H
-
-/*
- * Console callback routine numbers
- */
-#define CCB_GETC               0x01
-#define CCB_PUTS               0x02
-#define CCB_RESET_TERM         0x03
-#define CCB_SET_TERM_INT       0x04
-#define CCB_SET_TERM_CTL       0x05
-#define CCB_PROCESS_KEYCODE    0x06
-#define CCB_OPEN_CONSOLE       0x07
-#define CCB_CLOSE_CONSOLE      0x08
-
-#define CCB_OPEN               0x10
-#define CCB_CLOSE              0x11
-#define CCB_IOCTL              0x12
-#define CCB_READ               0x13
-#define CCB_WRITE              0x14
-
-#define CCB_SET_ENV            0x20
-#define CCB_RESET_ENV          0x21
-#define CCB_GET_ENV            0x22
-#define CCB_SAVE_ENV           0x23
-
-#define CCB_PSWITCH            0x30
-#define CCB_BIOS_EMUL          0x32
-
-/*
- * Environment variable numbers
- */
-#define ENV_AUTO_ACTION                0x01
-#define ENV_BOOT_DEV           0x02
-#define ENV_BOOTDEF_DEV                0x03
-#define ENV_BOOTED_DEV         0x04
-#define ENV_BOOT_FILE          0x05
-#define ENV_BOOTED_FILE                0x06
-#define ENV_BOOT_OSFLAGS       0x07
-#define ENV_BOOTED_OSFLAGS     0x08
-#define ENV_BOOT_RESET         0x09
-#define ENV_DUMP_DEV           0x0A
-#define ENV_ENABLE_AUDIT       0x0B
-#define ENV_LICENSE            0x0C
-#define ENV_CHAR_SET           0x0D
-#define ENV_LANGUAGE           0x0E
-#define ENV_TTY_DEV            0x0F
-
-#ifdef __KERNEL__
-#ifndef __ASSEMBLY__
-extern long callback_puts(long unit, const char *s, long length);
-extern long callback_getc(long unit);
-extern long callback_open_console(void);
-extern long callback_close_console(void);
-extern long callback_open(const char *device, long length);
-extern long callback_close(long unit);
-extern long callback_read(long channel, long count, const char *buf, long lbn);
-extern long callback_getenv(long id, const char *buf, unsigned long buf_size);
-extern long callback_setenv(long id, const char *buf, unsigned long buf_size);
-extern long callback_save_env(void);
-
-extern int srm_fixup(unsigned long new_callback_addr,
-                    unsigned long new_hwrpb_addr);
-extern long srm_puts(const char *, long);
-extern long srm_printk(const char *, ...)
-       __attribute__ ((format (printf, 1, 2)));
-
-struct crb_struct;
-struct hwrpb_struct;
-extern int callback_init_done;
-extern void * callback_init(void *);
-#endif /* __ASSEMBLY__ */
-#endif /* __KERNEL__ */
-
-#endif /* __AXP_CONSOLE_H */
diff --git a/include/asm-alpha/core_apecs.h b/include/asm-alpha/core_apecs.h
deleted file mode 100644 (file)
index 6785ff7..0000000
+++ /dev/null
@@ -1,517 +0,0 @@
-#ifndef __ALPHA_APECS__H__
-#define __ALPHA_APECS__H__
-
-#include <linux/types.h>
-#include <asm/compiler.h>
-
-/*
- * APECS is the internal name for the 2107x chipset which provides
- * memory controller and PCI access for the 21064 chip based systems.
- *
- * This file is based on:
- *
- * DECchip 21071-AA and DECchip 21072-AA Core Logic Chipsets
- * Data Sheet
- *
- * EC-N0648-72
- *
- *
- * david.rusling@reo.mts.dec.com Initial Version.
- *
- */
-
-/*
-   An AVANTI *might* be an XL, and an XL has only 27 bits of ISA address
-   that get passed through the PCI<->ISA bridge chip. So we've gotta use
-   both windows to max out the physical memory we can DMA to. Sigh...
-
-   If we try a window at 0 for 1GB as a work-around, we run into conflicts
-   with ISA/PCI bus memory which can't be relocated, like VGA aperture and
-   BIOS ROMs. So we must put the windows high enough to avoid these areas.
-
-   We put window 1 at BUS 64Mb for 64Mb, mapping physical 0 to 64Mb-1,
-   and window 2 at BUS 1Gb for 1Gb, mapping physical 0 to 1Gb-1.
-   Yes, this does map 0 to 64Mb-1 twice, but only window 1 will actually
-   be used for that range (via virt_to_bus()).
-
-   Note that we actually fudge the window 1 maximum as 48Mb instead of 64Mb,
-   to keep virt_to_bus() from returning an address in the first window, for
-   a data area that goes beyond the 64Mb first DMA window.  Sigh...
-   The fudge factor MUST match with <asm/dma.h> MAX_DMA_ADDRESS, but
-   we can't just use that here, because of header file looping... :-(
-
-   Window 1 will be used for all DMA from the ISA bus; yes, that does
-   limit what memory an ISA floppy or sound card or Ethernet can touch, but
-   it's also a known limitation on other platforms as well. We use the
-   same technique that is used on INTEL platforms with similar limitation:
-   set MAX_DMA_ADDRESS and clear some pages' DMAable flags during mem_init().
-   We trust that any ISA bus device drivers will *always* ask for DMAable
-   memory explicitly via kmalloc()/get_free_pages() flags arguments.
-
-   Note that most PCI bus devices' drivers do *not* explicitly ask for
-   DMAable memory; they count on being able to DMA to any memory they
-   get from kmalloc()/get_free_pages(). They will also use window 1 for
-   any physical memory accesses below 64Mb; the rest will be handled by
-   window 2, maxing out at 1Gb of memory. I trust this is enough... :-)
-
-   We hope that the area before the first window is large enough so that
-   there will be no overlap at the top end (64Mb). We *must* locate the
-   PCI cards' memory just below window 1, so that there's still the
-   possibility of being able to access it via SPARSE space. This is
-   important for cards such as the Matrox Millennium, whose Xserver
-   wants to access memory-mapped registers in byte and short lengths.
-
-   Note that the XL is treated differently from the AVANTI, even though
-   for most other things they are identical. It didn't seem reasonable to
-   make the AVANTI support pay for the limitations of the XL. It is true,
-   however, that an XL kernel will run on an AVANTI without problems.
-
-   %%% All of this should be obviated by the ability to route
-   everything through the iommu.
-*/
-
-/*
- * 21071-DA Control and Status registers.
- * These are used for PCI memory access.
- */
-#define APECS_IOC_DCSR                  (IDENT_ADDR + 0x1A0000000UL)
-#define APECS_IOC_PEAR                  (IDENT_ADDR + 0x1A0000020UL)
-#define APECS_IOC_SEAR                  (IDENT_ADDR + 0x1A0000040UL)
-#define APECS_IOC_DR1                   (IDENT_ADDR + 0x1A0000060UL)
-#define APECS_IOC_DR2                   (IDENT_ADDR + 0x1A0000080UL)
-#define APECS_IOC_DR3                   (IDENT_ADDR + 0x1A00000A0UL)
-
-#define APECS_IOC_TB1R                  (IDENT_ADDR + 0x1A00000C0UL)
-#define APECS_IOC_TB2R                  (IDENT_ADDR + 0x1A00000E0UL)
-
-#define APECS_IOC_PB1R                  (IDENT_ADDR + 0x1A0000100UL)
-#define APECS_IOC_PB2R                  (IDENT_ADDR + 0x1A0000120UL)
-
-#define APECS_IOC_PM1R                  (IDENT_ADDR + 0x1A0000140UL)
-#define APECS_IOC_PM2R                  (IDENT_ADDR + 0x1A0000160UL)
-
-#define APECS_IOC_HAXR0                 (IDENT_ADDR + 0x1A0000180UL)
-#define APECS_IOC_HAXR1                 (IDENT_ADDR + 0x1A00001A0UL)
-#define APECS_IOC_HAXR2                 (IDENT_ADDR + 0x1A00001C0UL)
-
-#define APECS_IOC_PMLT                  (IDENT_ADDR + 0x1A00001E0UL)
-
-#define APECS_IOC_TLBTAG0               (IDENT_ADDR + 0x1A0000200UL)
-#define APECS_IOC_TLBTAG1               (IDENT_ADDR + 0x1A0000220UL)
-#define APECS_IOC_TLBTAG2               (IDENT_ADDR + 0x1A0000240UL)
-#define APECS_IOC_TLBTAG3               (IDENT_ADDR + 0x1A0000260UL)
-#define APECS_IOC_TLBTAG4               (IDENT_ADDR + 0x1A0000280UL)
-#define APECS_IOC_TLBTAG5               (IDENT_ADDR + 0x1A00002A0UL)
-#define APECS_IOC_TLBTAG6               (IDENT_ADDR + 0x1A00002C0UL)
-#define APECS_IOC_TLBTAG7               (IDENT_ADDR + 0x1A00002E0UL)
-
-#define APECS_IOC_TLBDATA0              (IDENT_ADDR + 0x1A0000300UL)
-#define APECS_IOC_TLBDATA1              (IDENT_ADDR + 0x1A0000320UL)
-#define APECS_IOC_TLBDATA2              (IDENT_ADDR + 0x1A0000340UL)
-#define APECS_IOC_TLBDATA3              (IDENT_ADDR + 0x1A0000360UL)
-#define APECS_IOC_TLBDATA4              (IDENT_ADDR + 0x1A0000380UL)
-#define APECS_IOC_TLBDATA5              (IDENT_ADDR + 0x1A00003A0UL)
-#define APECS_IOC_TLBDATA6              (IDENT_ADDR + 0x1A00003C0UL)
-#define APECS_IOC_TLBDATA7              (IDENT_ADDR + 0x1A00003E0UL)
-
-#define APECS_IOC_TBIA                  (IDENT_ADDR + 0x1A0000400UL)
-
-
-/*
- * 21071-CA Control and Status registers.
- * These are used to program memory timing,
- *  configure memory and initialise the B-Cache.
- */
-#define APECS_MEM_GCR                  (IDENT_ADDR + 0x180000000UL)
-#define APECS_MEM_EDSR                 (IDENT_ADDR + 0x180000040UL)
-#define APECS_MEM_TAR                          (IDENT_ADDR + 0x180000060UL)
-#define APECS_MEM_ELAR                 (IDENT_ADDR + 0x180000080UL)
-#define APECS_MEM_EHAR                 (IDENT_ADDR + 0x1800000a0UL)
-#define APECS_MEM_SFT_RST              (IDENT_ADDR + 0x1800000c0UL)
-#define APECS_MEM_LDxLAR               (IDENT_ADDR + 0x1800000e0UL)
-#define APECS_MEM_LDxHAR               (IDENT_ADDR + 0x180000100UL)
-#define APECS_MEM_GTR                  (IDENT_ADDR + 0x180000200UL)
-#define APECS_MEM_RTR                  (IDENT_ADDR + 0x180000220UL)
-#define APECS_MEM_VFPR                 (IDENT_ADDR + 0x180000240UL)
-#define APECS_MEM_PDLDR                (IDENT_ADDR + 0x180000260UL)
-#define APECS_MEM_PDhDR                (IDENT_ADDR + 0x180000280UL)
-
-/* Bank x Base Address Register */
-#define APECS_MEM_B0BAR                (IDENT_ADDR + 0x180000800UL)
-#define APECS_MEM_B1BAR                (IDENT_ADDR + 0x180000820UL)
-#define APECS_MEM_B2BAR                (IDENT_ADDR + 0x180000840UL)
-#define APECS_MEM_B3BAR                (IDENT_ADDR + 0x180000860UL)
-#define APECS_MEM_B4BAR                (IDENT_ADDR + 0x180000880UL)
-#define APECS_MEM_B5BAR                (IDENT_ADDR + 0x1800008A0UL)
-#define APECS_MEM_B6BAR                (IDENT_ADDR + 0x1800008C0UL)
-#define APECS_MEM_B7BAR                (IDENT_ADDR + 0x1800008E0UL)
-#define APECS_MEM_B8BAR                (IDENT_ADDR + 0x180000900UL)
-
-/* Bank x Configuration Register */
-#define APECS_MEM_B0BCR                (IDENT_ADDR + 0x180000A00UL)
-#define APECS_MEM_B1BCR                (IDENT_ADDR + 0x180000A20UL)
-#define APECS_MEM_B2BCR                (IDENT_ADDR + 0x180000A40UL)
-#define APECS_MEM_B3BCR                (IDENT_ADDR + 0x180000A60UL)
-#define APECS_MEM_B4BCR                (IDENT_ADDR + 0x180000A80UL)
-#define APECS_MEM_B5BCR                (IDENT_ADDR + 0x180000AA0UL)
-#define APECS_MEM_B6BCR                (IDENT_ADDR + 0x180000AC0UL)
-#define APECS_MEM_B7BCR                (IDENT_ADDR + 0x180000AE0UL)
-#define APECS_MEM_B8BCR                (IDENT_ADDR + 0x180000B00UL)
-
-/* Bank x Timing Register A */
-#define APECS_MEM_B0TRA                (IDENT_ADDR + 0x180000C00UL)
-#define APECS_MEM_B1TRA                (IDENT_ADDR + 0x180000C20UL)
-#define APECS_MEM_B2TRA                (IDENT_ADDR + 0x180000C40UL)
-#define APECS_MEM_B3TRA                (IDENT_ADDR + 0x180000C60UL)
-#define APECS_MEM_B4TRA                (IDENT_ADDR + 0x180000C80UL)
-#define APECS_MEM_B5TRA                (IDENT_ADDR + 0x180000CA0UL)
-#define APECS_MEM_B6TRA                (IDENT_ADDR + 0x180000CC0UL)
-#define APECS_MEM_B7TRA                (IDENT_ADDR + 0x180000CE0UL)
-#define APECS_MEM_B8TRA                (IDENT_ADDR + 0x180000D00UL)
-
-/* Bank x Timing Register B */
-#define APECS_MEM_B0TRB                 (IDENT_ADDR + 0x180000E00UL)
-#define APECS_MEM_B1TRB                (IDENT_ADDR + 0x180000E20UL)
-#define APECS_MEM_B2TRB                (IDENT_ADDR + 0x180000E40UL)
-#define APECS_MEM_B3TRB                (IDENT_ADDR + 0x180000E60UL)
-#define APECS_MEM_B4TRB                (IDENT_ADDR + 0x180000E80UL)
-#define APECS_MEM_B5TRB                (IDENT_ADDR + 0x180000EA0UL)
-#define APECS_MEM_B6TRB                (IDENT_ADDR + 0x180000EC0UL)
-#define APECS_MEM_B7TRB                (IDENT_ADDR + 0x180000EE0UL)
-#define APECS_MEM_B8TRB                (IDENT_ADDR + 0x180000F00UL)
-
-
-/*
- * Memory spaces:
- */
-#define APECS_IACK_SC                  (IDENT_ADDR + 0x1b0000000UL)
-#define APECS_CONF                     (IDENT_ADDR + 0x1e0000000UL)
-#define APECS_IO                       (IDENT_ADDR + 0x1c0000000UL)
-#define APECS_SPARSE_MEM               (IDENT_ADDR + 0x200000000UL)
-#define APECS_DENSE_MEM                        (IDENT_ADDR + 0x300000000UL)
-
-
-/*
- * Bit definitions for I/O Controller status register 0:
- */
-#define APECS_IOC_STAT0_CMD            0xf
-#define APECS_IOC_STAT0_ERR            (1<<4)
-#define APECS_IOC_STAT0_LOST           (1<<5)
-#define APECS_IOC_STAT0_THIT           (1<<6)
-#define APECS_IOC_STAT0_TREF           (1<<7)
-#define APECS_IOC_STAT0_CODE_SHIFT     8
-#define APECS_IOC_STAT0_CODE_MASK      0x7
-#define APECS_IOC_STAT0_P_NBR_SHIFT    13
-#define APECS_IOC_STAT0_P_NBR_MASK     0x7ffff
-
-#define APECS_HAE_ADDRESS              APECS_IOC_HAXR1
-
-
-/*
- * Data structure for handling APECS machine checks:
- */
-
-struct el_apecs_mikasa_sysdata_mcheck
-{
-       unsigned long coma_gcr;
-       unsigned long coma_edsr;
-       unsigned long coma_ter;
-       unsigned long coma_elar;
-       unsigned long coma_ehar;
-       unsigned long coma_ldlr;
-       unsigned long coma_ldhr;
-       unsigned long coma_base0;
-       unsigned long coma_base1;
-       unsigned long coma_base2;
-       unsigned long coma_base3;
-       unsigned long coma_cnfg0;
-       unsigned long coma_cnfg1;
-       unsigned long coma_cnfg2;
-       unsigned long coma_cnfg3;
-       unsigned long epic_dcsr;
-       unsigned long epic_pear;
-       unsigned long epic_sear;
-       unsigned long epic_tbr1;
-       unsigned long epic_tbr2;
-       unsigned long epic_pbr1;
-       unsigned long epic_pbr2;
-       unsigned long epic_pmr1;
-       unsigned long epic_pmr2;
-       unsigned long epic_harx1;
-       unsigned long epic_harx2;
-       unsigned long epic_pmlt;
-       unsigned long epic_tag0;
-       unsigned long epic_tag1;
-       unsigned long epic_tag2;
-       unsigned long epic_tag3;
-       unsigned long epic_tag4;
-       unsigned long epic_tag5;
-       unsigned long epic_tag6;
-       unsigned long epic_tag7;
-       unsigned long epic_data0;
-       unsigned long epic_data1;
-       unsigned long epic_data2;
-       unsigned long epic_data3;
-       unsigned long epic_data4;
-       unsigned long epic_data5;
-       unsigned long epic_data6;
-       unsigned long epic_data7;
-
-       unsigned long pceb_vid;
-       unsigned long pceb_did;
-       unsigned long pceb_revision;
-       unsigned long pceb_command;
-       unsigned long pceb_status;
-       unsigned long pceb_latency;
-       unsigned long pceb_control;
-       unsigned long pceb_arbcon;
-       unsigned long pceb_arbpri;
-
-       unsigned long esc_id;
-       unsigned long esc_revision;
-       unsigned long esc_int0;
-       unsigned long esc_int1;
-       unsigned long esc_elcr0;
-       unsigned long esc_elcr1;
-       unsigned long esc_last_eisa;
-       unsigned long esc_nmi_stat;
-
-       unsigned long pci_ir;
-       unsigned long pci_imr;
-       unsigned long svr_mgr;
-};
-
-/* This for the normal APECS machines.  */
-struct el_apecs_sysdata_mcheck
-{
-       unsigned long coma_gcr;
-       unsigned long coma_edsr;
-       unsigned long coma_ter;
-       unsigned long coma_elar;
-       unsigned long coma_ehar;
-       unsigned long coma_ldlr;
-       unsigned long coma_ldhr;
-       unsigned long coma_base0;
-       unsigned long coma_base1;
-       unsigned long coma_base2;
-       unsigned long coma_cnfg0;
-       unsigned long coma_cnfg1;
-       unsigned long coma_cnfg2;
-       unsigned long epic_dcsr;
-       unsigned long epic_pear;
-       unsigned long epic_sear;
-       unsigned long epic_tbr1;
-       unsigned long epic_tbr2;
-       unsigned long epic_pbr1;
-       unsigned long epic_pbr2;
-       unsigned long epic_pmr1;
-       unsigned long epic_pmr2;
-       unsigned long epic_harx1;
-       unsigned long epic_harx2;
-       unsigned long epic_pmlt;
-       unsigned long epic_tag0;
-       unsigned long epic_tag1;
-       unsigned long epic_tag2;
-       unsigned long epic_tag3;
-       unsigned long epic_tag4;
-       unsigned long epic_tag5;
-       unsigned long epic_tag6;
-       unsigned long epic_tag7;
-       unsigned long epic_data0;
-       unsigned long epic_data1;
-       unsigned long epic_data2;
-       unsigned long epic_data3;
-       unsigned long epic_data4;
-       unsigned long epic_data5;
-       unsigned long epic_data6;
-       unsigned long epic_data7;
-};
-
-struct el_apecs_procdata
-{
-       unsigned long paltemp[32];  /* PAL TEMP REGS. */
-       /* EV4-specific fields */
-       unsigned long exc_addr;     /* Address of excepting instruction. */
-       unsigned long exc_sum;      /* Summary of arithmetic traps. */
-       unsigned long exc_mask;     /* Exception mask (from exc_sum). */
-       unsigned long iccsr;        /* IBox hardware enables. */
-       unsigned long pal_base;     /* Base address for PALcode. */
-       unsigned long hier;         /* Hardware Interrupt Enable. */
-       unsigned long hirr;         /* Hardware Interrupt Request. */
-       unsigned long csr;          /* D-stream fault info. */
-       unsigned long dc_stat;      /* D-cache status (ECC/Parity Err). */
-       unsigned long dc_addr;      /* EV3 Phys Addr for ECC/DPERR. */
-       unsigned long abox_ctl;     /* ABox Control Register. */
-       unsigned long biu_stat;     /* BIU Status. */
-       unsigned long biu_addr;     /* BUI Address. */
-       unsigned long biu_ctl;      /* BIU Control. */
-       unsigned long fill_syndrome;/* For correcting ECC errors. */
-       unsigned long fill_addr;    /* Cache block which was being read */
-       unsigned long va;           /* Effective VA of fault or miss. */
-       unsigned long bc_tag;       /* Backup Cache Tag Probe Results.*/
-};
-
-
-#ifdef __KERNEL__
-
-#ifndef __EXTERN_INLINE
-#define __EXTERN_INLINE extern inline
-#define __IO_EXTERN_INLINE
-#endif
-
-/*
- * I/O functions:
- *
- * Unlike Jensen, the APECS machines have no concept of local
- * I/O---everything goes over the PCI bus.
- *
- * There is plenty room for optimization here.  In particular,
- * the Alpha's insb/insw/extb/extw should be useful in moving
- * data to/from the right byte-lanes.
- */
-
-#define vip    volatile int __force *
-#define vuip   volatile unsigned int __force *
-#define vulp   volatile unsigned long __force *
-
-#define APECS_SET_HAE                                          \
-       do {                                                    \
-               if (addr >= (1UL << 24)) {                      \
-                       unsigned long msb = addr & 0xf8000000;  \
-                       addr -= msb;                            \
-                       set_hae(msb);                           \
-               }                                               \
-       } while (0)
-
-__EXTERN_INLINE unsigned int apecs_ioread8(void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       unsigned long result, base_and_type;
-
-       if (addr >= APECS_DENSE_MEM) {
-               addr -= APECS_DENSE_MEM;
-               APECS_SET_HAE;
-               base_and_type = APECS_SPARSE_MEM + 0x00;
-       } else {
-               addr -= APECS_IO;
-               base_and_type = APECS_IO + 0x00;
-       }
-
-       result = *(vip) ((addr << 5) + base_and_type);
-       return __kernel_extbl(result, addr & 3);
-}
-
-__EXTERN_INLINE void apecs_iowrite8(u8 b, void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       unsigned long w, base_and_type;
-
-       if (addr >= APECS_DENSE_MEM) {
-               addr -= APECS_DENSE_MEM;
-               APECS_SET_HAE;
-               base_and_type = APECS_SPARSE_MEM + 0x00;
-       } else {
-               addr -= APECS_IO;
-               base_and_type = APECS_IO + 0x00;
-       }
-
-       w = __kernel_insbl(b, addr & 3);
-       *(vuip) ((addr << 5) + base_and_type) = w;
-}
-
-__EXTERN_INLINE unsigned int apecs_ioread16(void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       unsigned long result, base_and_type;
-
-       if (addr >= APECS_DENSE_MEM) {
-               addr -= APECS_DENSE_MEM;
-               APECS_SET_HAE;
-               base_and_type = APECS_SPARSE_MEM + 0x08;
-       } else {
-               addr -= APECS_IO;
-               base_and_type = APECS_IO + 0x08;
-       }
-
-       result = *(vip) ((addr << 5) + base_and_type);
-       return __kernel_extwl(result, addr & 3);
-}
-
-__EXTERN_INLINE void apecs_iowrite16(u16 b, void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       unsigned long w, base_and_type;
-
-       if (addr >= APECS_DENSE_MEM) {
-               addr -= APECS_DENSE_MEM;
-               APECS_SET_HAE;
-               base_and_type = APECS_SPARSE_MEM + 0x08;
-       } else {
-               addr -= APECS_IO;
-               base_and_type = APECS_IO + 0x08;
-       }
-
-       w = __kernel_inswl(b, addr & 3);
-       *(vuip) ((addr << 5) + base_and_type) = w;
-}
-
-__EXTERN_INLINE unsigned int apecs_ioread32(void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       if (addr < APECS_DENSE_MEM)
-               addr = ((addr - APECS_IO) << 5) + APECS_IO + 0x18;
-       return *(vuip)addr;
-}
-
-__EXTERN_INLINE void apecs_iowrite32(u32 b, void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       if (addr < APECS_DENSE_MEM)
-               addr = ((addr - APECS_IO) << 5) + APECS_IO + 0x18;
-       *(vuip)addr = b;
-}
-
-__EXTERN_INLINE void __iomem *apecs_ioportmap(unsigned long addr)
-{
-       return (void __iomem *)(addr + APECS_IO);
-}
-
-__EXTERN_INLINE void __iomem *apecs_ioremap(unsigned long addr,
-                                           unsigned long size)
-{
-       return (void __iomem *)(addr + APECS_DENSE_MEM);
-}
-
-__EXTERN_INLINE int apecs_is_ioaddr(unsigned long addr)
-{
-       return addr >= IDENT_ADDR + 0x180000000UL;
-}
-
-__EXTERN_INLINE int apecs_is_mmio(const volatile void __iomem *addr)
-{
-       return (unsigned long)addr >= APECS_DENSE_MEM;
-}
-
-#undef APECS_SET_HAE
-
-#undef vip
-#undef vuip
-#undef vulp
-
-#undef __IO_PREFIX
-#define __IO_PREFIX            apecs
-#define apecs_trivial_io_bw    0
-#define apecs_trivial_io_lq    0
-#define apecs_trivial_rw_bw    2
-#define apecs_trivial_rw_lq    1
-#define apecs_trivial_iounmap  1
-#include <asm/io_trivial.h>
-
-#ifdef __IO_EXTERN_INLINE
-#undef __EXTERN_INLINE
-#undef __IO_EXTERN_INLINE
-#endif
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_APECS__H__ */
diff --git a/include/asm-alpha/core_cia.h b/include/asm-alpha/core_cia.h
deleted file mode 100644 (file)
index 9e0516c..0000000
+++ /dev/null
@@ -1,500 +0,0 @@
-#ifndef __ALPHA_CIA__H__
-#define __ALPHA_CIA__H__
-
-/* Define to experiment with fitting everything into one 512MB HAE window.  */
-#define CIA_ONE_HAE_WINDOW 1
-
-#include <linux/types.h>
-#include <asm/compiler.h>
-
-/*
- * CIA is the internal name for the 21171 chipset which provides
- * memory controller and PCI access for the 21164 chip based systems.
- * Also supported here is the 21172 (CIA-2) and 21174 (PYXIS).
- *
- * The lineage is a bit confused, since the 21174 was reportedly started
- * from the 21171 Pass 1 mask, and so is missing bug fixes that appear
- * in 21171 Pass 2 and 21172, but it also contains additional features.
- *
- * This file is based on:
- *
- * DECchip 21171 Core Logic Chipset
- * Technical Reference Manual
- *
- * EC-QE18B-TE
- *
- * david.rusling@reo.mts.dec.com Initial Version.
- *
- */
-
-/*
- * CIA ADDRESS BIT DEFINITIONS
- *
- *  3333 3333 3322 2222 2222 1111 1111 11
- *  9876 5432 1098 7654 3210 9876 5432 1098 7654 3210
- *  ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
- *  1                                             000
- *  ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
- *  |                                             |\|
- *  |                               Byte Enable --+ |
- *  |                             Transfer Length --+
- *  +-- IO space, not cached
- *
- *   Byte      Transfer
- *   Enable    Length    Transfer  Byte    Address
- *   adr<6:5>  adr<4:3>  Length    Enable  Adder
- *   ---------------------------------------------
- *      00        00      Byte      1110   0x000
- *      01        00      Byte      1101   0x020
- *      10        00      Byte      1011   0x040
- *      11        00      Byte      0111   0x060
- *
- *      00        01      Word      1100   0x008
- *      01        01      Word      1001   0x028 <= Not supported in this code.
- *      10        01      Word      0011   0x048
- *
- *      00        10      Tribyte   1000   0x010
- *      01        10      Tribyte   0001   0x030
- *
- *      10        11      Longword  0000   0x058
- *
- *      Note that byte enables are asserted low.
- *
- */
-
-#define CIA_MEM_R1_MASK 0x1fffffff  /* SPARSE Mem region 1 mask is 29 bits */
-#define CIA_MEM_R2_MASK 0x07ffffff  /* SPARSE Mem region 2 mask is 27 bits */
-#define CIA_MEM_R3_MASK 0x03ffffff  /* SPARSE Mem region 3 mask is 26 bits */
-
-/*
- * 21171-CA Control and Status Registers
- */
-#define CIA_IOC_CIA_REV                        (IDENT_ADDR + 0x8740000080UL)
-#  define CIA_REV_MASK                 0xff
-#define CIA_IOC_PCI_LAT                        (IDENT_ADDR + 0x87400000C0UL)
-#define CIA_IOC_CIA_CTRL               (IDENT_ADDR + 0x8740000100UL)
-#  define CIA_CTRL_PCI_EN              (1 << 0)
-#  define CIA_CTRL_PCI_LOCK_EN         (1 << 1)
-#  define CIA_CTRL_PCI_LOOP_EN         (1 << 2)
-#  define CIA_CTRL_FST_BB_EN           (1 << 3)
-#  define CIA_CTRL_PCI_MST_EN          (1 << 4)
-#  define CIA_CTRL_PCI_MEM_EN          (1 << 5)
-#  define CIA_CTRL_PCI_REQ64_EN                (1 << 6)
-#  define CIA_CTRL_PCI_ACK64_EN                (1 << 7)
-#  define CIA_CTRL_ADDR_PE_EN          (1 << 8)
-#  define CIA_CTRL_PERR_EN             (1 << 9)
-#  define CIA_CTRL_FILL_ERR_EN         (1 << 10)
-#  define CIA_CTRL_MCHK_ERR_EN         (1 << 11)
-#  define CIA_CTRL_ECC_CHK_EN          (1 << 12)
-#  define CIA_CTRL_ASSERT_IDLE_BC      (1 << 13)
-#  define CIA_CTRL_COM_IDLE_BC         (1 << 14)
-#  define CIA_CTRL_CSR_IOA_BYPASS      (1 << 15)
-#  define CIA_CTRL_IO_FLUSHREQ_EN      (1 << 16)
-#  define CIA_CTRL_CPU_FLUSHREQ_EN     (1 << 17)
-#  define CIA_CTRL_ARB_CPU_EN          (1 << 18)
-#  define CIA_CTRL_EN_ARB_LINK         (1 << 19)
-#  define CIA_CTRL_RD_TYPE_SHIFT       20
-#  define CIA_CTRL_RL_TYPE_SHIFT       24
-#  define CIA_CTRL_RM_TYPE_SHIFT       28
-#  define CIA_CTRL_EN_DMA_RD_PERF      (1 << 31)
-#define CIA_IOC_CIA_CNFG               (IDENT_ADDR + 0x8740000140UL)
-#  define CIA_CNFG_IOA_BWEN            (1 << 0)
-#  define CIA_CNFG_PCI_MWEN            (1 << 4)
-#  define CIA_CNFG_PCI_DWEN            (1 << 5)
-#  define CIA_CNFG_PCI_WLEN            (1 << 8)
-#define CIA_IOC_FLASH_CTRL             (IDENT_ADDR + 0x8740000200UL)
-#define CIA_IOC_HAE_MEM                        (IDENT_ADDR + 0x8740000400UL)
-#define CIA_IOC_HAE_IO                 (IDENT_ADDR + 0x8740000440UL)
-#define CIA_IOC_CFG                    (IDENT_ADDR + 0x8740000480UL)
-#define CIA_IOC_CACK_EN                        (IDENT_ADDR + 0x8740000600UL)
-#  define CIA_CACK_EN_LOCK_EN          (1 << 0)
-#  define CIA_CACK_EN_MB_EN            (1 << 1)
-#  define CIA_CACK_EN_SET_DIRTY_EN     (1 << 2)
-#  define CIA_CACK_EN_BC_VICTIM_EN     (1 << 3)
-
-
-/*
- * 21171-CA Diagnostic Registers
- */
-#define CIA_IOC_CIA_DIAG               (IDENT_ADDR + 0x8740002000UL)
-#define CIA_IOC_DIAG_CHECK             (IDENT_ADDR + 0x8740003000UL)
-
-/*
- * 21171-CA Performance Monitor registers
- */
-#define CIA_IOC_PERF_MONITOR           (IDENT_ADDR + 0x8740004000UL)
-#define CIA_IOC_PERF_CONTROL           (IDENT_ADDR + 0x8740004040UL)
-
-/*
- * 21171-CA Error registers
- */
-#define CIA_IOC_CPU_ERR0               (IDENT_ADDR + 0x8740008000UL)
-#define CIA_IOC_CPU_ERR1               (IDENT_ADDR + 0x8740008040UL)
-#define CIA_IOC_CIA_ERR                        (IDENT_ADDR + 0x8740008200UL)
-#  define CIA_ERR_COR_ERR              (1 << 0)
-#  define CIA_ERR_UN_COR_ERR           (1 << 1)
-#  define CIA_ERR_CPU_PE               (1 << 2)
-#  define CIA_ERR_MEM_NEM              (1 << 3)
-#  define CIA_ERR_PCI_SERR             (1 << 4)
-#  define CIA_ERR_PERR                 (1 << 5)
-#  define CIA_ERR_PCI_ADDR_PE          (1 << 6)
-#  define CIA_ERR_RCVD_MAS_ABT         (1 << 7)
-#  define CIA_ERR_RCVD_TAR_ABT         (1 << 8)
-#  define CIA_ERR_PA_PTE_INV           (1 << 9)
-#  define CIA_ERR_FROM_WRT_ERR         (1 << 10)
-#  define CIA_ERR_IOA_TIMEOUT          (1 << 11)
-#  define CIA_ERR_LOST_CORR_ERR                (1 << 16)
-#  define CIA_ERR_LOST_UN_CORR_ERR     (1 << 17)
-#  define CIA_ERR_LOST_CPU_PE          (1 << 18)
-#  define CIA_ERR_LOST_MEM_NEM         (1 << 19)
-#  define CIA_ERR_LOST_PERR            (1 << 21)
-#  define CIA_ERR_LOST_PCI_ADDR_PE     (1 << 22)
-#  define CIA_ERR_LOST_RCVD_MAS_ABT    (1 << 23)
-#  define CIA_ERR_LOST_RCVD_TAR_ABT    (1 << 24)
-#  define CIA_ERR_LOST_PA_PTE_INV      (1 << 25)
-#  define CIA_ERR_LOST_FROM_WRT_ERR    (1 << 26)
-#  define CIA_ERR_LOST_IOA_TIMEOUT     (1 << 27)
-#  define CIA_ERR_VALID                        (1 << 31)
-#define CIA_IOC_CIA_STAT               (IDENT_ADDR + 0x8740008240UL)
-#define CIA_IOC_ERR_MASK               (IDENT_ADDR + 0x8740008280UL)
-#define CIA_IOC_CIA_SYN                        (IDENT_ADDR + 0x8740008300UL)
-#define CIA_IOC_MEM_ERR0               (IDENT_ADDR + 0x8740008400UL)
-#define CIA_IOC_MEM_ERR1               (IDENT_ADDR + 0x8740008440UL)
-#define CIA_IOC_PCI_ERR0               (IDENT_ADDR + 0x8740008800UL)
-#define CIA_IOC_PCI_ERR1               (IDENT_ADDR + 0x8740008840UL)
-#define CIA_IOC_PCI_ERR3               (IDENT_ADDR + 0x8740008880UL)
-
-/*
- * 21171-CA System configuration registers
- */
-#define CIA_IOC_MCR                    (IDENT_ADDR + 0x8750000000UL)
-#define CIA_IOC_MBA0                   (IDENT_ADDR + 0x8750000600UL)
-#define CIA_IOC_MBA2                   (IDENT_ADDR + 0x8750000680UL)
-#define CIA_IOC_MBA4                   (IDENT_ADDR + 0x8750000700UL)
-#define CIA_IOC_MBA6                   (IDENT_ADDR + 0x8750000780UL)
-#define CIA_IOC_MBA8                   (IDENT_ADDR + 0x8750000800UL)
-#define CIA_IOC_MBAA                   (IDENT_ADDR + 0x8750000880UL)
-#define CIA_IOC_MBAC                   (IDENT_ADDR + 0x8750000900UL)
-#define CIA_IOC_MBAE                   (IDENT_ADDR + 0x8750000980UL)
-#define CIA_IOC_TMG0                   (IDENT_ADDR + 0x8750000B00UL)
-#define CIA_IOC_TMG1                   (IDENT_ADDR + 0x8750000B40UL)
-#define CIA_IOC_TMG2                   (IDENT_ADDR + 0x8750000B80UL)
-
-/*
- * 2117A-CA PCI Address and Scatter-Gather Registers.
- */
-#define CIA_IOC_PCI_TBIA               (IDENT_ADDR + 0x8760000100UL)
-
-#define CIA_IOC_PCI_W0_BASE            (IDENT_ADDR + 0x8760000400UL)
-#define CIA_IOC_PCI_W0_MASK            (IDENT_ADDR + 0x8760000440UL)
-#define CIA_IOC_PCI_T0_BASE            (IDENT_ADDR + 0x8760000480UL)
-
-#define CIA_IOC_PCI_W1_BASE            (IDENT_ADDR + 0x8760000500UL)
-#define CIA_IOC_PCI_W1_MASK            (IDENT_ADDR + 0x8760000540UL)
-#define CIA_IOC_PCI_T1_BASE            (IDENT_ADDR + 0x8760000580UL)
-
-#define CIA_IOC_PCI_W2_BASE            (IDENT_ADDR + 0x8760000600UL)
-#define CIA_IOC_PCI_W2_MASK            (IDENT_ADDR + 0x8760000640UL)
-#define CIA_IOC_PCI_T2_BASE            (IDENT_ADDR + 0x8760000680UL)
-
-#define CIA_IOC_PCI_W3_BASE            (IDENT_ADDR + 0x8760000700UL)
-#define CIA_IOC_PCI_W3_MASK            (IDENT_ADDR + 0x8760000740UL)
-#define CIA_IOC_PCI_T3_BASE            (IDENT_ADDR + 0x8760000780UL)
-
-#define CIA_IOC_PCI_Wn_BASE(N) (IDENT_ADDR + 0x8760000400UL + (N)*0x100) 
-#define CIA_IOC_PCI_Wn_MASK(N) (IDENT_ADDR + 0x8760000440UL + (N)*0x100) 
-#define CIA_IOC_PCI_Tn_BASE(N) (IDENT_ADDR + 0x8760000480UL + (N)*0x100) 
-
-#define CIA_IOC_PCI_W_DAC              (IDENT_ADDR + 0x87600007C0UL)
-
-/*
- * 2117A-CA Address Translation Registers.
- */
-
-/* 8 tag registers, the first 4 of which are lockable.  */
-#define CIA_IOC_TB_TAGn(n) \
-       (IDENT_ADDR + 0x8760000800UL + (n)*0x40)
-
-/* 4 page registers per tag register.  */
-#define CIA_IOC_TBn_PAGEm(n,m) \
-       (IDENT_ADDR + 0x8760001000UL + (n)*0x100 + (m)*0x40)
-
-/*
- * Memory spaces:
- */
-#define CIA_IACK_SC                    (IDENT_ADDR + 0x8720000000UL)
-#define CIA_CONF                       (IDENT_ADDR + 0x8700000000UL)
-#define CIA_IO                         (IDENT_ADDR + 0x8580000000UL)
-#define CIA_SPARSE_MEM                 (IDENT_ADDR + 0x8000000000UL)
-#define CIA_SPARSE_MEM_R2              (IDENT_ADDR + 0x8400000000UL)
-#define CIA_SPARSE_MEM_R3              (IDENT_ADDR + 0x8500000000UL)
-#define CIA_DENSE_MEM                  (IDENT_ADDR + 0x8600000000UL)
-#define CIA_BW_MEM                     (IDENT_ADDR + 0x8800000000UL)
-#define CIA_BW_IO                      (IDENT_ADDR + 0x8900000000UL)
-#define CIA_BW_CFG_0                   (IDENT_ADDR + 0x8a00000000UL)
-#define CIA_BW_CFG_1                   (IDENT_ADDR + 0x8b00000000UL)
-
-/*
- * ALCOR's GRU ASIC registers
- */
-#define GRU_INT_REQ                    (IDENT_ADDR + 0x8780000000UL)
-#define GRU_INT_MASK                   (IDENT_ADDR + 0x8780000040UL)
-#define GRU_INT_EDGE                   (IDENT_ADDR + 0x8780000080UL)
-#define GRU_INT_HILO                   (IDENT_ADDR + 0x87800000C0UL)
-#define GRU_INT_CLEAR                  (IDENT_ADDR + 0x8780000100UL)
-
-#define GRU_CACHE_CNFG                 (IDENT_ADDR + 0x8780000200UL)
-#define GRU_SCR                                (IDENT_ADDR + 0x8780000300UL)
-#define GRU_LED                                (IDENT_ADDR + 0x8780000800UL)
-#define GRU_RESET                      (IDENT_ADDR + 0x8780000900UL)
-
-#define ALCOR_GRU_INT_REQ_BITS         0x800fffffUL
-#define XLT_GRU_INT_REQ_BITS           0x80003fffUL
-#define GRU_INT_REQ_BITS               (alpha_mv.sys.cia.gru_int_req_bits+0)
-
-/*
- * PYXIS interrupt control registers
- */
-#define PYXIS_INT_REQ                  (IDENT_ADDR + 0x87A0000000UL)
-#define PYXIS_INT_MASK                 (IDENT_ADDR + 0x87A0000040UL)
-#define PYXIS_INT_HILO                 (IDENT_ADDR + 0x87A00000C0UL)
-#define PYXIS_INT_ROUTE                        (IDENT_ADDR + 0x87A0000140UL)
-#define PYXIS_GPO                      (IDENT_ADDR + 0x87A0000180UL)
-#define PYXIS_INT_CNFG                 (IDENT_ADDR + 0x87A00001C0UL)
-#define PYXIS_RT_COUNT                 (IDENT_ADDR + 0x87A0000200UL)
-#define PYXIS_INT_TIME                 (IDENT_ADDR + 0x87A0000240UL)
-#define PYXIS_IIC_CTRL                 (IDENT_ADDR + 0x87A00002C0UL)
-#define PYXIS_RESET                    (IDENT_ADDR + 0x8780000900UL)
-
-/* Offset between ram physical addresses and pci64 DAC bus addresses.  */
-#define PYXIS_DAC_OFFSET               (1UL << 40)
-
-/*
- * Data structure for handling CIA machine checks.
- */
-
-/* System-specific info.  */
-struct el_CIA_sysdata_mcheck {
-       unsigned long   cpu_err0;
-       unsigned long   cpu_err1;
-       unsigned long   cia_err;
-       unsigned long   cia_stat;
-       unsigned long   err_mask;
-       unsigned long   cia_syn;
-       unsigned long   mem_err0;
-       unsigned long   mem_err1;
-       unsigned long   pci_err0;
-       unsigned long   pci_err1;
-       unsigned long   pci_err2;
-};
-
-
-#ifdef __KERNEL__
-
-#ifndef __EXTERN_INLINE
-/* Do not touch, this should *NOT* be static inline */
-#define __EXTERN_INLINE extern inline
-#define __IO_EXTERN_INLINE
-#endif
-
-/*
- * I/O functions:
- *
- * CIA (the 2117x PCI/memory support chipset for the EV5 (21164)
- * series of processors uses a sparse address mapping scheme to
- * get at PCI memory and I/O.
- */
-
-/*
- * Memory functions.  64-bit and 32-bit accesses are done through
- * dense memory space, everything else through sparse space.
- *
- * For reading and writing 8 and 16 bit quantities we need to
- * go through one of the three sparse address mapping regions
- * and use the HAE_MEM CSR to provide some bits of the address.
- * The following few routines use only sparse address region 1
- * which gives 1Gbyte of accessible space which relates exactly
- * to the amount of PCI memory mapping *into* system address space.
- * See p 6-17 of the specification but it looks something like this:
- *
- * 21164 Address:
- *
- *          3         2         1
- * 9876543210987654321098765432109876543210
- * 1ZZZZ0.PCI.QW.Address............BBLL
- *
- * ZZ = SBZ
- * BB = Byte offset
- * LL = Transfer length
- *
- * PCI Address:
- *
- * 3         2         1
- * 10987654321098765432109876543210
- * HHH....PCI.QW.Address........ 00
- *
- * HHH = 31:29 HAE_MEM CSR
- *
- */
-
-#define vip    volatile int __force *
-#define vuip   volatile unsigned int __force *
-#define vulp   volatile unsigned long __force *
-
-__EXTERN_INLINE unsigned int cia_ioread8(void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       unsigned long result, base_and_type;
-
-       if (addr >= CIA_DENSE_MEM)
-               base_and_type = CIA_SPARSE_MEM + 0x00;
-       else
-               base_and_type = CIA_IO + 0x00;
-
-       /* We can use CIA_MEM_R1_MASK for io ports too, since it is large
-          enough to cover all io ports, and smaller than CIA_IO.  */
-       addr &= CIA_MEM_R1_MASK;
-       result = *(vip) ((addr << 5) + base_and_type);
-       return __kernel_extbl(result, addr & 3);
-}
-
-__EXTERN_INLINE void cia_iowrite8(u8 b, void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       unsigned long w, base_and_type;
-
-       if (addr >= CIA_DENSE_MEM)
-               base_and_type = CIA_SPARSE_MEM + 0x00;
-       else
-               base_and_type = CIA_IO + 0x00;
-
-       addr &= CIA_MEM_R1_MASK;
-       w = __kernel_insbl(b, addr & 3);
-       *(vuip) ((addr << 5) + base_and_type) = w;
-}
-
-__EXTERN_INLINE unsigned int cia_ioread16(void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       unsigned long result, base_and_type;
-
-       if (addr >= CIA_DENSE_MEM)
-               base_and_type = CIA_SPARSE_MEM + 0x08;
-       else
-               base_and_type = CIA_IO + 0x08;
-
-       addr &= CIA_MEM_R1_MASK;
-       result = *(vip) ((addr << 5) + base_and_type);
-       return __kernel_extwl(result, addr & 3);
-}
-
-__EXTERN_INLINE void cia_iowrite16(u16 b, void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       unsigned long w, base_and_type;
-
-       if (addr >= CIA_DENSE_MEM)
-               base_and_type = CIA_SPARSE_MEM + 0x08;
-       else
-               base_and_type = CIA_IO + 0x08;
-
-       addr &= CIA_MEM_R1_MASK;
-       w = __kernel_inswl(b, addr & 3);
-       *(vuip) ((addr << 5) + base_and_type) = w;
-}
-
-__EXTERN_INLINE unsigned int cia_ioread32(void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       if (addr < CIA_DENSE_MEM)
-               addr = ((addr - CIA_IO) << 5) + CIA_IO + 0x18;
-       return *(vuip)addr;
-}
-
-__EXTERN_INLINE void cia_iowrite32(u32 b, void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       if (addr < CIA_DENSE_MEM)
-               addr = ((addr - CIA_IO) << 5) + CIA_IO + 0x18;
-       *(vuip)addr = b;
-}
-
-__EXTERN_INLINE void __iomem *cia_ioportmap(unsigned long addr)
-{
-       return (void __iomem *)(addr + CIA_IO);
-}
-
-__EXTERN_INLINE void __iomem *cia_ioremap(unsigned long addr,
-                                         unsigned long size)
-{
-       return (void __iomem *)(addr + CIA_DENSE_MEM);
-}
-
-__EXTERN_INLINE int cia_is_ioaddr(unsigned long addr)
-{
-       return addr >= IDENT_ADDR + 0x8000000000UL;
-}
-
-__EXTERN_INLINE int cia_is_mmio(const volatile void __iomem *addr)
-{
-       return (unsigned long)addr >= CIA_DENSE_MEM;
-}
-
-__EXTERN_INLINE void __iomem *cia_bwx_ioportmap(unsigned long addr)
-{
-       return (void __iomem *)(addr + CIA_BW_IO);
-}
-
-__EXTERN_INLINE void __iomem *cia_bwx_ioremap(unsigned long addr,
-                                             unsigned long size)
-{
-       return (void __iomem *)(addr + CIA_BW_MEM);
-}
-
-__EXTERN_INLINE int cia_bwx_is_ioaddr(unsigned long addr)
-{
-       return addr >= IDENT_ADDR + 0x8000000000UL;
-}
-
-__EXTERN_INLINE int cia_bwx_is_mmio(const volatile void __iomem *addr)
-{
-       return (unsigned long)addr < CIA_BW_IO;
-}
-
-#undef vip
-#undef vuip
-#undef vulp
-
-#undef __IO_PREFIX
-#define __IO_PREFIX            cia
-#define cia_trivial_rw_bw      2
-#define cia_trivial_rw_lq      1
-#define cia_trivial_io_bw      0
-#define cia_trivial_io_lq      0
-#define cia_trivial_iounmap    1
-#include <asm/io_trivial.h>
-
-#undef __IO_PREFIX
-#define __IO_PREFIX            cia_bwx
-#define cia_bwx_trivial_rw_bw  1
-#define cia_bwx_trivial_rw_lq  1
-#define cia_bwx_trivial_io_bw  1
-#define cia_bwx_trivial_io_lq  1
-#define cia_bwx_trivial_iounmap        1
-#include <asm/io_trivial.h>
-
-#undef __IO_PREFIX
-#ifdef CONFIG_ALPHA_PYXIS
-#define __IO_PREFIX            cia_bwx
-#else
-#define __IO_PREFIX            cia
-#endif
-
-#ifdef __IO_EXTERN_INLINE
-#undef __EXTERN_INLINE
-#undef __IO_EXTERN_INLINE
-#endif
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_CIA__H__ */
diff --git a/include/asm-alpha/core_irongate.h b/include/asm-alpha/core_irongate.h
deleted file mode 100644 (file)
index 24b2db5..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-#ifndef __ALPHA_IRONGATE__H__
-#define __ALPHA_IRONGATE__H__
-
-#include <linux/types.h>
-#include <asm/compiler.h>
-
-/*
- * IRONGATE is the internal name for the AMD-751 K7 core logic chipset
- * which provides memory controller and PCI access for NAUTILUS-based
- * EV6 (21264) systems.
- *
- * This file is based on:
- *
- * IronGate management library, (c) 1999 Alpha Processor, Inc.
- * Copyright (C) 1999 Alpha Processor, Inc.,
- *     (David Daniel, Stig Telfer, Soohoon Lee)
- */
-
-/*
- * The 21264 supports, and internally recognizes, a 44-bit physical
- * address space that is divided equally between memory address space
- * and I/O address space. Memory address space resides in the lower
- * half of the physical address space (PA[43]=0) and I/O address space
- * resides in the upper half of the physical address space (PA[43]=1).
- */
-
-/*
- * Irongate CSR map.  Some of the CSRs are 8 or 16 bits, but all access
- * through the routines given is 32-bit.
- *
- * The first 0x40 bytes are standard as per the PCI spec.
- */
-
-typedef volatile __u32 igcsr32;
-
-typedef struct {
-       igcsr32 dev_vendor;             /* 0x00 - device ID, vendor ID */
-       igcsr32 stat_cmd;               /* 0x04 - status, command */
-       igcsr32 class;                  /* 0x08 - class code, rev ID */
-       igcsr32 latency;                /* 0x0C - header type, PCI latency */
-       igcsr32 bar0;                   /* 0x10 - BAR0 - AGP */
-       igcsr32 bar1;                   /* 0x14 - BAR1 - GART */
-       igcsr32 bar2;                   /* 0x18 - Power Management reg block */
-
-       igcsr32 rsrvd0[6];              /* 0x1C-0x33 reserved */
-
-       igcsr32 capptr;                 /* 0x34 - Capabilities pointer */
-
-       igcsr32 rsrvd1[2];              /* 0x38-0x3F reserved */
-
-       igcsr32 bacsr10;                /* 0x40 - base address chip selects */
-       igcsr32 bacsr32;                /* 0x44 - base address chip selects */
-       igcsr32 bacsr54_eccms761;       /* 0x48 - 751: base addr. chip selects
-                                                 761: ECC, mode/status */
-
-       igcsr32 rsrvd2[1];              /* 0x4C-0x4F reserved */
-
-       igcsr32 drammap;                /* 0x50 - address mapping control */
-       igcsr32 dramtm;                 /* 0x54 - timing, driver strength */
-       igcsr32 dramms;                 /* 0x58 - DRAM mode/status */
-
-       igcsr32 rsrvd3[1];              /* 0x5C-0x5F reserved */
-
-       igcsr32 biu0;                   /* 0x60 - bus interface unit */
-       igcsr32 biusip;                 /* 0x64 - Serial initialisation pkt */
-
-       igcsr32 rsrvd4[2];              /* 0x68-0x6F reserved */
-
-       igcsr32 mro;                    /* 0x70 - memory request optimiser */
-
-       igcsr32 rsrvd5[3];              /* 0x74-0x7F reserved */
-
-       igcsr32 whami;                  /* 0x80 - who am I */
-       igcsr32 pciarb;                 /* 0x84 - PCI arbitration control */
-       igcsr32 pcicfg;                 /* 0x88 - PCI config status */
-
-       igcsr32 rsrvd6[4];              /* 0x8C-0x9B reserved */
-
-       igcsr32 pci_mem;                /* 0x9C - PCI top of memory,
-                                                 761 only */
-
-       /* AGP (bus 1) control registers */
-       igcsr32 agpcap;                 /* 0xA0 - AGP Capability Identifier */
-       igcsr32 agpstat;                /* 0xA4 - AGP status register */
-       igcsr32 agpcmd;                 /* 0xA8 - AGP control register */
-       igcsr32 agpva;                  /* 0xAC - AGP Virtual Address Space */
-       igcsr32 agpmode;                /* 0xB0 - AGP/GART mode control */
-} Irongate0;
-
-
-typedef struct {
-
-       igcsr32 dev_vendor;             /* 0x00 - Device and Vendor IDs */
-       igcsr32 stat_cmd;               /* 0x04 - Status and Command regs */
-       igcsr32 class;                  /* 0x08 - subclass, baseclass etc */
-       igcsr32 htype;                  /* 0x0C - header type (at 0x0E) */
-       igcsr32 rsrvd0[2];              /* 0x10-0x17 reserved */
-       igcsr32 busnos;                 /* 0x18 - Primary, secondary bus nos */
-       igcsr32 io_baselim_regs;        /* 0x1C - IO base, IO lim, AGP status */
-       igcsr32 mem_baselim;            /* 0x20 - memory base, memory lim */
-       igcsr32 pfmem_baselim;          /* 0x24 - prefetchable base, lim */
-       igcsr32 rsrvd1[2];              /* 0x28-0x2F reserved */
-       igcsr32 io_baselim;             /* 0x30 - IO base, IO limit */
-       igcsr32 rsrvd2[2];              /* 0x34-0x3B - reserved */
-       igcsr32 interrupt;              /* 0x3C - interrupt, PCI bridge ctrl */
-
-} Irongate1;
-
-extern igcsr32 *IronECC;
-
-/*
- * Memory spaces:
- */
-
-/* Irongate is consistent with a subset of the Tsunami memory map */
-#ifdef USE_48_BIT_KSEG
-#define IRONGATE_BIAS 0x80000000000UL
-#else
-#define IRONGATE_BIAS 0x10000000000UL
-#endif
-
-
-#define IRONGATE_MEM           (IDENT_ADDR | IRONGATE_BIAS | 0x000000000UL)
-#define IRONGATE_IACK_SC       (IDENT_ADDR | IRONGATE_BIAS | 0x1F8000000UL)
-#define IRONGATE_IO            (IDENT_ADDR | IRONGATE_BIAS | 0x1FC000000UL)
-#define IRONGATE_CONF          (IDENT_ADDR | IRONGATE_BIAS | 0x1FE000000UL)
-
-/*
- * PCI Configuration space accesses are formed like so:
- *
- * 0x1FE << 24 |  : 2 2 2 2 1 1 1 1 : 1 1 1 1 1 1 0 0 : 0 0 0 0 0 0 0 0 :
- *                : 3 2 1 0 9 8 7 6 : 5 4 3 2 1 0 9 8 : 7 6 5 4 3 2 1 0 :
- *                  ---bus numer---   -device-- -fun-   ---register----
- */
-
-#define IGCSR(dev,fun,reg)     ( IRONGATE_CONF | \
-                               ((dev)<<11) | \
-                               ((fun)<<8) | \
-                               (reg) )
-
-#define IRONGATE0              ((Irongate0 *) IGCSR(0, 0, 0))
-#define IRONGATE1              ((Irongate1 *) IGCSR(1, 0, 0))
-
-/*
- * Data structure for handling IRONGATE machine checks:
- * This is the standard OSF logout frame
- */
-
-#define SCB_Q_SYSERR   0x620                   /* OSF definitions */
-#define SCB_Q_PROCERR  0x630
-#define SCB_Q_SYSMCHK  0x660
-#define SCB_Q_PROCMCHK 0x670
-
-struct el_IRONGATE_sysdata_mcheck {
-       __u32 FrameSize;                 /* Bytes, including this field */
-       __u32 FrameFlags;                /* <31> = Retry, <30> = Second Error */
-       __u32 CpuOffset;                 /* Offset to CPU-specific into */
-       __u32 SystemOffset;              /* Offset to system-specific info */
-       __u32 MCHK_Code;
-       __u32 MCHK_Frame_Rev;
-       __u64 I_STAT;
-       __u64 DC_STAT;
-       __u64 C_ADDR;
-       __u64 DC1_SYNDROME;
-       __u64 DC0_SYNDROME;
-       __u64 C_STAT;
-       __u64 C_STS;
-       __u64 RESERVED0;
-       __u64 EXC_ADDR;
-       __u64 IER_CM;
-       __u64 ISUM;
-       __u64 MM_STAT;
-       __u64 PAL_BASE;
-       __u64 I_CTL;
-       __u64 PCTX;
-};
-
-
-#ifdef __KERNEL__
-
-#ifndef __EXTERN_INLINE
-#define __EXTERN_INLINE extern inline
-#define __IO_EXTERN_INLINE
-#endif
-
-/*
- * I/O functions:
- *
- * IRONGATE (AMD-751) PCI/memory support chip for the EV6 (21264) and
- * K7 can only use linear accesses to get at PCI memory and I/O spaces.
- */
-
-/*
- * Memory functions.  All accesses are done through linear space.
- */
-
-__EXTERN_INLINE void __iomem *irongate_ioportmap(unsigned long addr)
-{
-       return (void __iomem *)(addr + IRONGATE_IO);
-}
-
-extern void __iomem *irongate_ioremap(unsigned long addr, unsigned long size);
-extern void irongate_iounmap(volatile void __iomem *addr);
-
-__EXTERN_INLINE int irongate_is_ioaddr(unsigned long addr)
-{
-       return addr >= IRONGATE_MEM;
-}
-
-__EXTERN_INLINE int irongate_is_mmio(const volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long)xaddr;
-       return addr < IRONGATE_IO || addr >= IRONGATE_CONF;
-}
-
-#undef __IO_PREFIX
-#define __IO_PREFIX                    irongate
-#define irongate_trivial_rw_bw         1
-#define irongate_trivial_rw_lq         1
-#define irongate_trivial_io_bw         1
-#define irongate_trivial_io_lq         1
-#define irongate_trivial_iounmap       0
-#include <asm/io_trivial.h>
-
-#ifdef __IO_EXTERN_INLINE
-#undef __EXTERN_INLINE
-#undef __IO_EXTERN_INLINE
-#endif
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_IRONGATE__H__ */
diff --git a/include/asm-alpha/core_lca.h b/include/asm-alpha/core_lca.h
deleted file mode 100644 (file)
index f7cb4b4..0000000
+++ /dev/null
@@ -1,361 +0,0 @@
-#ifndef __ALPHA_LCA__H__
-#define __ALPHA_LCA__H__
-
-#include <asm/system.h>
-#include <asm/compiler.h>
-
-/*
- * Low Cost Alpha (LCA) definitions (these apply to 21066 and 21068,
- * for example).
- *
- * This file is based on:
- *
- *     DECchip 21066 and DECchip 21068 Alpha AXP Microprocessors
- *     Hardware Reference Manual; Digital Equipment Corp.; May 1994;
- *     Maynard, MA; Order Number: EC-N2681-71.
- */
-
-/*
- * NOTE: The LCA uses a Host Address Extension (HAE) register to access
- *      PCI addresses that are beyond the first 27 bits of address
- *      space.  Updating the HAE requires an external cycle (and
- *      a memory barrier), which tends to be slow.  Instead of updating
- *      it on each sparse memory access, we keep the current HAE value
- *      cached in variable cache_hae.  Only if the cached HAE differs
- *      from the desired HAE value do we actually updated HAE register.
- *      The HAE register is preserved by the interrupt handler entry/exit
- *      code, so this scheme works even in the presence of interrupts.
- *
- * Dense memory space doesn't require the HAE, but is restricted to
- * aligned 32 and 64 bit accesses.  Special Cycle and Interrupt
- * Acknowledge cycles may also require the use of the HAE.  The LCA
- * limits I/O address space to the bottom 24 bits of address space,
- * but this easily covers the 16 bit ISA I/O address space.
- */
-
-/*
- * NOTE 2! The memory operations do not set any memory barriers, as
- * it's not needed for cases like a frame buffer that is essentially
- * memory-like.  You need to do them by hand if the operations depend
- * on ordering.
- *
- * Similarly, the port I/O operations do a "mb" only after a write
- * operation: if an mb is needed before (as in the case of doing
- * memory mapped I/O first, and then a port I/O operation to the same
- * device), it needs to be done by hand.
- *
- * After the above has bitten me 100 times, I'll give up and just do
- * the mb all the time, but right now I'm hoping this will work out.
- * Avoiding mb's may potentially be a noticeable speed improvement,
- * but I can't honestly say I've tested it.
- *
- * Handling interrupts that need to do mb's to synchronize to
- * non-interrupts is another fun race area.  Don't do it (because if
- * you do, I'll have to do *everything* with interrupts disabled,
- * ugh).
- */
-
-/*
- * Memory Controller registers:
- */
-#define LCA_MEM_BCR0           (IDENT_ADDR + 0x120000000UL)
-#define LCA_MEM_BCR1           (IDENT_ADDR + 0x120000008UL)
-#define LCA_MEM_BCR2           (IDENT_ADDR + 0x120000010UL)
-#define LCA_MEM_BCR3           (IDENT_ADDR + 0x120000018UL)
-#define LCA_MEM_BMR0           (IDENT_ADDR + 0x120000020UL)
-#define LCA_MEM_BMR1           (IDENT_ADDR + 0x120000028UL)
-#define LCA_MEM_BMR2           (IDENT_ADDR + 0x120000030UL)
-#define LCA_MEM_BMR3           (IDENT_ADDR + 0x120000038UL)
-#define LCA_MEM_BTR0           (IDENT_ADDR + 0x120000040UL)
-#define LCA_MEM_BTR1           (IDENT_ADDR + 0x120000048UL)
-#define LCA_MEM_BTR2           (IDENT_ADDR + 0x120000050UL)
-#define LCA_MEM_BTR3           (IDENT_ADDR + 0x120000058UL)
-#define LCA_MEM_GTR            (IDENT_ADDR + 0x120000060UL)
-#define LCA_MEM_ESR            (IDENT_ADDR + 0x120000068UL)
-#define LCA_MEM_EAR            (IDENT_ADDR + 0x120000070UL)
-#define LCA_MEM_CAR            (IDENT_ADDR + 0x120000078UL)
-#define LCA_MEM_VGR            (IDENT_ADDR + 0x120000080UL)
-#define LCA_MEM_PLM            (IDENT_ADDR + 0x120000088UL)
-#define LCA_MEM_FOR            (IDENT_ADDR + 0x120000090UL)
-
-/*
- * I/O Controller registers:
- */
-#define LCA_IOC_HAE            (IDENT_ADDR + 0x180000000UL)
-#define LCA_IOC_CONF           (IDENT_ADDR + 0x180000020UL)
-#define LCA_IOC_STAT0          (IDENT_ADDR + 0x180000040UL)
-#define LCA_IOC_STAT1          (IDENT_ADDR + 0x180000060UL)
-#define LCA_IOC_TBIA           (IDENT_ADDR + 0x180000080UL)
-#define LCA_IOC_TB_ENA         (IDENT_ADDR + 0x1800000a0UL)
-#define LCA_IOC_SFT_RST                (IDENT_ADDR + 0x1800000c0UL)
-#define LCA_IOC_PAR_DIS                (IDENT_ADDR + 0x1800000e0UL)
-#define LCA_IOC_W_BASE0                (IDENT_ADDR + 0x180000100UL)
-#define LCA_IOC_W_BASE1                (IDENT_ADDR + 0x180000120UL)
-#define LCA_IOC_W_MASK0                (IDENT_ADDR + 0x180000140UL)
-#define LCA_IOC_W_MASK1                (IDENT_ADDR + 0x180000160UL)
-#define LCA_IOC_T_BASE0                (IDENT_ADDR + 0x180000180UL)
-#define LCA_IOC_T_BASE1                (IDENT_ADDR + 0x1800001a0UL)
-#define LCA_IOC_TB_TAG0                (IDENT_ADDR + 0x188000000UL)
-#define LCA_IOC_TB_TAG1                (IDENT_ADDR + 0x188000020UL)
-#define LCA_IOC_TB_TAG2                (IDENT_ADDR + 0x188000040UL)
-#define LCA_IOC_TB_TAG3                (IDENT_ADDR + 0x188000060UL)
-#define LCA_IOC_TB_TAG4                (IDENT_ADDR + 0x188000070UL)
-#define LCA_IOC_TB_TAG5                (IDENT_ADDR + 0x1880000a0UL)
-#define LCA_IOC_TB_TAG6                (IDENT_ADDR + 0x1880000c0UL)
-#define LCA_IOC_TB_TAG7                (IDENT_ADDR + 0x1880000e0UL)
-
-/*
- * Memory spaces:
- */
-#define LCA_IACK_SC            (IDENT_ADDR + 0x1a0000000UL)
-#define LCA_CONF               (IDENT_ADDR + 0x1e0000000UL)
-#define LCA_IO                 (IDENT_ADDR + 0x1c0000000UL)
-#define LCA_SPARSE_MEM         (IDENT_ADDR + 0x200000000UL)
-#define LCA_DENSE_MEM          (IDENT_ADDR + 0x300000000UL)
-
-/*
- * Bit definitions for I/O Controller status register 0:
- */
-#define LCA_IOC_STAT0_CMD              0xf
-#define LCA_IOC_STAT0_ERR              (1<<4)
-#define LCA_IOC_STAT0_LOST             (1<<5)
-#define LCA_IOC_STAT0_THIT             (1<<6)
-#define LCA_IOC_STAT0_TREF             (1<<7)
-#define LCA_IOC_STAT0_CODE_SHIFT       8
-#define LCA_IOC_STAT0_CODE_MASK                0x7
-#define LCA_IOC_STAT0_P_NBR_SHIFT      13
-#define LCA_IOC_STAT0_P_NBR_MASK       0x7ffff
-
-#define LCA_HAE_ADDRESS                LCA_IOC_HAE
-
-/* LCA PMR Power Management register defines */
-#define LCA_PMR_ADDR   (IDENT_ADDR + 0x120000098UL)
-#define LCA_PMR_PDIV    0x7                     /* Primary clock divisor */
-#define LCA_PMR_ODIV    0x38                    /* Override clock divisor */
-#define LCA_PMR_INTO    0x40                    /* Interrupt override */
-#define LCA_PMR_DMAO    0x80                    /* DMA override */
-#define LCA_PMR_OCCEB   0xffff0000L             /* Override cycle counter - even bits */
-#define LCA_PMR_OCCOB   0xffff000000000000L     /* Override cycle counter - even bits */
-#define LCA_PMR_PRIMARY_MASK    0xfffffffffffffff8L
-
-/* LCA PMR Macros */
-
-#define LCA_READ_PMR        (*(volatile unsigned long *)LCA_PMR_ADDR)
-#define LCA_WRITE_PMR(d)    (*((volatile unsigned long *)LCA_PMR_ADDR) = (d))
-
-#define LCA_GET_PRIMARY(r)  ((r) & LCA_PMR_PDIV)
-#define LCA_GET_OVERRIDE(r) (((r) >> 3) & LCA_PMR_PDIV)
-#define LCA_SET_PRIMARY_CLOCK(r, c) ((r) = (((r) & LCA_PMR_PRIMARY_MASK)|(c)))
-
-/* LCA PMR Divisor values */
-#define LCA_PMR_DIV_1   0x0
-#define LCA_PMR_DIV_1_5 0x1
-#define LCA_PMR_DIV_2   0x2
-#define LCA_PMR_DIV_4   0x3
-#define LCA_PMR_DIV_8   0x4
-#define LCA_PMR_DIV_16  0x5
-#define LCA_PMR_DIV_MIN DIV_1
-#define LCA_PMR_DIV_MAX DIV_16
-
-
-/*
- * Data structure for handling LCA machine checks.  Correctable errors
- * result in a short logout frame, uncorrectable ones in a long one.
- */
-struct el_lca_mcheck_short {
-       struct el_common        h;              /* common logout header */
-       unsigned long           esr;            /* error-status register */
-       unsigned long           ear;            /* error-address register */
-       unsigned long           dc_stat;        /* dcache status register */
-       unsigned long           ioc_stat0;      /* I/O controller status register 0 */
-       unsigned long           ioc_stat1;      /* I/O controller status register 1 */
-};
-
-struct el_lca_mcheck_long {
-       struct el_common        h;              /* common logout header */
-       unsigned long           pt[31];         /* PAL temps */
-       unsigned long           exc_addr;       /* exception address */
-       unsigned long           pad1[3];
-       unsigned long           pal_base;       /* PALcode base address */
-       unsigned long           hier;           /* hw interrupt enable */
-       unsigned long           hirr;           /* hw interrupt request */
-       unsigned long           mm_csr;         /* MMU control & status */
-       unsigned long           dc_stat;        /* data cache status */
-       unsigned long           dc_addr;        /* data cache addr register */
-       unsigned long           abox_ctl;       /* address box control register */
-       unsigned long           esr;            /* error status register */
-       unsigned long           ear;            /* error address register */
-       unsigned long           car;            /* cache control register */
-       unsigned long           ioc_stat0;      /* I/O controller status register 0 */
-       unsigned long           ioc_stat1;      /* I/O controller status register 1 */
-       unsigned long           va;             /* virtual address register */
-};
-
-union el_lca {
-       struct el_common *              c;
-       struct el_lca_mcheck_long *     l;
-       struct el_lca_mcheck_short *    s;
-};
-
-#ifdef __KERNEL__
-
-#ifndef __EXTERN_INLINE
-#define __EXTERN_INLINE extern inline
-#define __IO_EXTERN_INLINE
-#endif
-
-/*
- * I/O functions:
- *
- * Unlike Jensen, the Noname machines have no concept of local
- * I/O---everything goes over the PCI bus.
- *
- * There is plenty room for optimization here.  In particular,
- * the Alpha's insb/insw/extb/extw should be useful in moving
- * data to/from the right byte-lanes.
- */
-
-#define vip    volatile int __force *
-#define vuip   volatile unsigned int __force *
-#define vulp   volatile unsigned long __force *
-
-#define LCA_SET_HAE                                            \
-       do {                                                    \
-               if (addr >= (1UL << 24)) {                      \
-                       unsigned long msb = addr & 0xf8000000;  \
-                       addr -= msb;                            \
-                       set_hae(msb);                           \
-               }                                               \
-       } while (0)
-
-
-__EXTERN_INLINE unsigned int lca_ioread8(void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       unsigned long result, base_and_type;
-
-       if (addr >= LCA_DENSE_MEM) {
-               addr -= LCA_DENSE_MEM;
-               LCA_SET_HAE;
-               base_and_type = LCA_SPARSE_MEM + 0x00;
-       } else {
-               addr -= LCA_IO;
-               base_and_type = LCA_IO + 0x00;
-       }
-
-       result = *(vip) ((addr << 5) + base_and_type);
-       return __kernel_extbl(result, addr & 3);
-}
-
-__EXTERN_INLINE void lca_iowrite8(u8 b, void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       unsigned long w, base_and_type;
-
-       if (addr >= LCA_DENSE_MEM) {
-               addr -= LCA_DENSE_MEM;
-               LCA_SET_HAE;
-               base_and_type = LCA_SPARSE_MEM + 0x00;
-       } else {
-               addr -= LCA_IO;
-               base_and_type = LCA_IO + 0x00;
-       }
-
-       w = __kernel_insbl(b, addr & 3);
-       *(vuip) ((addr << 5) + base_and_type) = w;
-}
-
-__EXTERN_INLINE unsigned int lca_ioread16(void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       unsigned long result, base_and_type;
-
-       if (addr >= LCA_DENSE_MEM) {
-               addr -= LCA_DENSE_MEM;
-               LCA_SET_HAE;
-               base_and_type = LCA_SPARSE_MEM + 0x08;
-       } else {
-               addr -= LCA_IO;
-               base_and_type = LCA_IO + 0x08;
-       }
-
-       result = *(vip) ((addr << 5) + base_and_type);
-       return __kernel_extwl(result, addr & 3);
-}
-
-__EXTERN_INLINE void lca_iowrite16(u16 b, void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       unsigned long w, base_and_type;
-
-       if (addr >= LCA_DENSE_MEM) {
-               addr -= LCA_DENSE_MEM;
-               LCA_SET_HAE;
-               base_and_type = LCA_SPARSE_MEM + 0x08;
-       } else {
-               addr -= LCA_IO;
-               base_and_type = LCA_IO + 0x08;
-       }
-
-       w = __kernel_inswl(b, addr & 3);
-       *(vuip) ((addr << 5) + base_and_type) = w;
-}
-
-__EXTERN_INLINE unsigned int lca_ioread32(void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       if (addr < LCA_DENSE_MEM)
-               addr = ((addr - LCA_IO) << 5) + LCA_IO + 0x18;
-       return *(vuip)addr;
-}
-
-__EXTERN_INLINE void lca_iowrite32(u32 b, void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       if (addr < LCA_DENSE_MEM)
-               addr = ((addr - LCA_IO) << 5) + LCA_IO + 0x18;
-       *(vuip)addr = b;
-}
-
-__EXTERN_INLINE void __iomem *lca_ioportmap(unsigned long addr)
-{
-       return (void __iomem *)(addr + LCA_IO);
-}
-
-__EXTERN_INLINE void __iomem *lca_ioremap(unsigned long addr,
-                                         unsigned long size)
-{
-       return (void __iomem *)(addr + LCA_DENSE_MEM);
-}
-
-__EXTERN_INLINE int lca_is_ioaddr(unsigned long addr)
-{
-       return addr >= IDENT_ADDR + 0x120000000UL;
-}
-
-__EXTERN_INLINE int lca_is_mmio(const volatile void __iomem *addr)
-{
-       return (unsigned long)addr >= LCA_DENSE_MEM;
-}
-
-#undef vip
-#undef vuip
-#undef vulp
-
-#undef __IO_PREFIX
-#define __IO_PREFIX            lca
-#define lca_trivial_rw_bw      2
-#define lca_trivial_rw_lq      1
-#define lca_trivial_io_bw      0
-#define lca_trivial_io_lq      0
-#define lca_trivial_iounmap    1
-#include <asm/io_trivial.h>
-
-#ifdef __IO_EXTERN_INLINE
-#undef __EXTERN_INLINE
-#undef __IO_EXTERN_INLINE
-#endif
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_LCA__H__ */
diff --git a/include/asm-alpha/core_marvel.h b/include/asm-alpha/core_marvel.h
deleted file mode 100644 (file)
index 30d55fe..0000000
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- * Marvel systems use the IO7 I/O chip provides PCI/PCIX/AGP access
- *
- * This file is based on:
- *
- * Marvel / EV7 System Programmer's Manual
- * Revision 1.00
- * 14 May 2001
- */
-
-#ifndef __ALPHA_MARVEL__H__
-#define __ALPHA_MARVEL__H__
-
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <linux/spinlock.h>
-
-#include <asm/compiler.h>
-
-#define MARVEL_MAX_PIDS                 32 /* as long as we rely on 43-bit superpage */
-#define MARVEL_IRQ_VEC_PE_SHIFT        (10)
-#define MARVEL_IRQ_VEC_IRQ_MASK        ((1 << MARVEL_IRQ_VEC_PE_SHIFT) - 1)
-#define MARVEL_NR_IRQS         \
-       (16 + (MARVEL_MAX_PIDS * (1 << MARVEL_IRQ_VEC_PE_SHIFT)))
-
-/*
- * EV7 RBOX Registers
- */
-typedef struct {
-       volatile unsigned long csr __attribute__((aligned(16)));
-} ev7_csr;
-
-typedef struct {
-       ev7_csr RBOX_CFG;               /* 0x0000 */
-       ev7_csr RBOX_NSVC;
-       ev7_csr RBOX_EWVC;
-       ev7_csr RBOX_WHAMI;
-       ev7_csr RBOX_TCTL;              /* 0x0040 */
-       ev7_csr RBOX_INT;
-       ev7_csr RBOX_IMASK;
-       ev7_csr RBOX_IREQ;
-       ev7_csr RBOX_INTQ;              /* 0x0080 */
-       ev7_csr RBOX_INTA;
-       ev7_csr RBOX_IT;
-       ev7_csr RBOX_SCRATCH1;
-       ev7_csr RBOX_SCRATCH2;          /* 0x00c0 */
-       ev7_csr RBOX_L_ERR;
-} ev7_csrs;
-
-/*
- * EV7 CSR addressing macros
- */
-#define EV7_MASK40(addr)        ((addr) & ((1UL << 41) - 1))
-#define EV7_KERN_ADDR(addr)    ((void *)(IDENT_ADDR | EV7_MASK40(addr)))
-
-#define EV7_PE_MASK            0x1ffUL /* 9 bits ( 256 + mem/io ) */
-#define EV7_IPE(pe)            ((~((long)(pe)) & EV7_PE_MASK) << 35)
-
-#define EV7_CSR_PHYS(pe, off)  (EV7_IPE(pe) | (0x7FFCUL << 20) | (off))
-#define EV7_CSRS_PHYS(pe)      (EV7_CSR_PHYS(pe, 0UL))
-
-#define EV7_CSR_KERN(pe, off)  (EV7_KERN_ADDR(EV7_CSR_PHYS(pe, off)))
-#define EV7_CSRS_KERN(pe)      (EV7_KERN_ADDR(EV7_CSRS_PHYS(pe)))
-
-#define EV7_CSR_OFFSET(name)   ((unsigned long)&((ev7_csrs *)NULL)->name.csr)
-
-/*
- * IO7 registers
- */
-typedef struct {
-       volatile unsigned long csr __attribute__((aligned(64)));
-} io7_csr;
-
-typedef struct {
-       /* I/O Port Control Registers */
-       io7_csr POx_CTRL;               /* 0x0000 */
-       io7_csr POx_CACHE_CTL;
-       io7_csr POx_TIMER;
-       io7_csr POx_IO_ADR_EXT;
-       io7_csr POx_MEM_ADR_EXT;        /* 0x0100 */
-       io7_csr POx_XCAL_CTRL;
-       io7_csr rsvd1[2];       /* ?? spec doesn't show 0x180 */
-       io7_csr POx_DM_SOURCE;          /* 0x0200 */
-       io7_csr POx_DM_DEST;
-       io7_csr POx_DM_SIZE;
-       io7_csr POx_DM_CTRL;
-       io7_csr rsvd2[4];               /* 0x0300 */
-
-       /* AGP Control Registers -- port 3 only */
-       io7_csr AGP_CAP_ID;             /* 0x0400 */
-       io7_csr AGP_STAT;
-       io7_csr AGP_CMD;
-       io7_csr rsvd3;
-
-       /* I/O Port Monitor Registers */
-       io7_csr POx_MONCTL;             /* 0x0500 */
-       io7_csr POx_CTRA;
-       io7_csr POx_CTRB;
-       io7_csr POx_CTR56;
-       io7_csr POx_SCRATCH;            /* 0x0600 */
-       io7_csr POx_XTRA_A;
-       io7_csr POx_XTRA_TS;
-       io7_csr POx_XTRA_Z;
-       io7_csr rsvd4;                  /* 0x0700 */
-       io7_csr POx_THRESHA;
-       io7_csr POx_THRESHB;
-       io7_csr rsvd5[33];
-
-       /* System Address Space Window Control Registers */
-
-       io7_csr POx_WBASE[4];           /* 0x1000 */
-       io7_csr POx_WMASK[4];
-       io7_csr POx_TBASE[4];
-       io7_csr POx_SG_TBIA;
-       io7_csr POx_MSI_WBASE;
-       io7_csr rsvd6[50];
-
-       /* I/O Port Error Registers */
-       io7_csr POx_ERR_SUM;
-       io7_csr POx_FIRST_ERR;
-       io7_csr POx_MSK_HEI;
-       io7_csr POx_TLB_ERR;
-       io7_csr POx_SPL_COMPLT;
-       io7_csr POx_TRANS_SUM;
-       io7_csr POx_FRC_PCI_ERR;
-       io7_csr POx_MULT_ERR;
-       io7_csr rsvd7[8];
-
-       /* I/O Port End of Interrupt Registers */
-       io7_csr EOI_DAT;
-       io7_csr rsvd8[7];
-       io7_csr POx_IACK_SPECIAL;
-       io7_csr rsvd9[103];
-} io7_ioport_csrs;
-
-typedef struct {
-       io7_csr IO_ASIC_REV;            /* 0x30.0000 */
-       io7_csr IO_SYS_REV;
-       io7_csr SER_CHAIN3;
-       io7_csr PO7_RST1;
-       io7_csr PO7_RST2;               /* 0x30.0100 */
-       io7_csr POx_RST[4];
-       io7_csr IO7_DWNH;
-       io7_csr IO7_MAF;
-       io7_csr IO7_MAF_TO;
-       io7_csr IO7_ACC_CLUMP;          /* 0x30.0300 */
-       io7_csr IO7_PMASK;
-       io7_csr IO7_IOMASK;
-       io7_csr IO7_UPH;
-       io7_csr IO7_UPH_TO;             /* 0x30.0400 */
-       io7_csr RBX_IREQ_OFF;
-       io7_csr RBX_INTA_OFF;
-       io7_csr INT_RTY;
-       io7_csr PO7_MONCTL;             /* 0x30.0500 */
-       io7_csr PO7_CTRA;
-       io7_csr PO7_CTRB;
-       io7_csr PO7_CTR56;
-       io7_csr PO7_SCRATCH;            /* 0x30.0600 */
-       io7_csr PO7_XTRA_A;
-       io7_csr PO7_XTRA_TS;
-       io7_csr PO7_XTRA_Z;
-       io7_csr PO7_PMASK;              /* 0x30.0700 */
-       io7_csr PO7_THRESHA;
-       io7_csr PO7_THRESHB;
-       io7_csr rsvd1[97];
-       io7_csr PO7_ERROR_SUM;          /* 0x30.2000 */
-       io7_csr PO7_BHOLE_MASK;
-       io7_csr PO7_HEI_MSK;
-       io7_csr PO7_CRD_MSK;
-       io7_csr PO7_UNCRR_SYM;          /* 0x30.2100 */
-       io7_csr PO7_CRRCT_SYM;
-       io7_csr PO7_ERR_PKT[2];
-       io7_csr PO7_UGBGE_SYM;          /* 0x30.2200 */
-       io7_csr rsbv2[887];
-       io7_csr PO7_LSI_CTL[128];       /* 0x31.0000 */
-       io7_csr rsvd3[123];
-       io7_csr HLT_CTL;                /* 0x31.3ec0 */
-       io7_csr HPI_CTL;                /* 0x31.3f00 */
-       io7_csr CRD_CTL;
-       io7_csr STV_CTL;
-       io7_csr HEI_CTL;
-       io7_csr PO7_MSI_CTL[16];        /* 0x31.4000 */
-       io7_csr rsvd4[240];
-
-       /*
-        * Interrupt Diagnostic / Test
-        */
-       struct {
-               io7_csr INT_PND;
-               io7_csr INT_CLR;
-               io7_csr INT_EOI;
-               io7_csr rsvd[29];
-       } INT_DIAG[4];
-       io7_csr rsvd5[125];             /* 0x31.a000 */
-       io7_csr MISC_PND;               /* 0x31.b800 */
-       io7_csr rsvd6[31];
-       io7_csr MSI_PND[16];            /* 0x31.c000 */
-       io7_csr rsvd7[16];
-       io7_csr MSI_CLR[16];            /* 0x31.c800 */
-} io7_port7_csrs;
-
-/* 
- * IO7 DMA Window Base register (POx_WBASEx)
- */
-#define wbase_m_ena  0x1
-#define wbase_m_sg   0x2
-#define wbase_m_dac  0x4
-#define wbase_m_addr 0xFFF00000
-union IO7_POx_WBASE {
-       struct {
-               unsigned ena : 1;       /* <0>                  */
-               unsigned sg : 1;        /* <1>                  */
-               unsigned dac : 1;       /* <2> -- window 3 only */
-               unsigned rsvd1 : 17; 
-               unsigned addr : 12;     /* <31:20>              */
-               unsigned rsvd2 : 32;
-       } bits;
-       unsigned as_long[2];
-       unsigned as_quad;
-};
-
-/*
- * IO7 IID (Interrupt IDentifier) format
- *
- * For level-sensative interrupts, int_num is encoded as:
- *
- *     bus/port        slot/device     INTx
- *     <7:5>           <4:2>           <1:0>
- */
-union IO7_IID {
-       struct {
-               unsigned int_num : 9;           /* <8:0>        */
-               unsigned tpu_mask : 4;          /* <12:9> rsvd  */
-               unsigned msi : 1;               /* 13           */
-               unsigned ipe : 10;              /* <23:14>      */
-               unsigned long rsvd : 40;                
-       } bits;
-       unsigned int as_long[2];
-       unsigned long as_quad;
-};
-
-/*
- * IO7 addressing macros
- */
-#define IO7_KERN_ADDR(addr)    (EV7_KERN_ADDR(addr))
-
-#define IO7_PORT_MASK          0x07UL  /* 3 bits of port          */
-
-#define IO7_IPE(pe)            (EV7_IPE(pe))
-#define IO7_IPORT(port)                ((~((long)(port)) & IO7_PORT_MASK) << 32)
-
-#define IO7_HOSE(pe, port)     (IO7_IPE(pe) | IO7_IPORT(port))
-
-#define IO7_MEM_PHYS(pe, port) (IO7_HOSE(pe, port) | 0x00000000UL)
-#define IO7_CONF_PHYS(pe, port)        (IO7_HOSE(pe, port) | 0xFE000000UL)
-#define IO7_IO_PHYS(pe, port)  (IO7_HOSE(pe, port) | 0xFF000000UL)
-#define IO7_CSR_PHYS(pe, port, off) \
-                                (IO7_HOSE(pe, port) | 0xFF800000UL | (off))
-#define IO7_CSRS_PHYS(pe, port)        (IO7_CSR_PHYS(pe, port, 0UL))
-#define IO7_PORT7_CSRS_PHYS(pe) (IO7_CSR_PHYS(pe, 7, 0x300000UL))
-
-#define IO7_MEM_KERN(pe, port)      (IO7_KERN_ADDR(IO7_MEM_PHYS(pe, port)))
-#define IO7_CONF_KERN(pe, port)     (IO7_KERN_ADDR(IO7_CONF_PHYS(pe, port)))
-#define IO7_IO_KERN(pe, port)       (IO7_KERN_ADDR(IO7_IO_PHYS(pe, port)))
-#define IO7_CSR_KERN(pe, port, off) (IO7_KERN_ADDR(IO7_CSR_PHYS(pe,port,off)))
-#define IO7_CSRS_KERN(pe, port)     (IO7_KERN_ADDR(IO7_CSRS_PHYS(pe, port)))
-#define IO7_PORT7_CSRS_KERN(pe)            (IO7_KERN_ADDR(IO7_PORT7_CSRS_PHYS(pe)))
-
-#define IO7_PLL_RNGA(pll)      (((pll) >> 3) & 0x7)
-#define IO7_PLL_RNGB(pll)      (((pll) >> 6) & 0x7)
-
-#define IO7_MEM_SPACE          (2UL * 1024 * 1024 * 1024)      /* 2GB MEM */
-#define IO7_IO_SPACE           (8UL * 1024 * 1024)             /* 8MB I/O */
-
-/* 
- * Offset between ram physical addresses and pci64 DAC addresses
- */
-#define IO7_DAC_OFFSET         (1UL << 49)
-
-/*
- * This is needed to satisify the IO() macro used in initializing the machvec
- */
-#define MARVEL_IACK_SC                                                         \
-        ((unsigned long)                                               \
-        (&(((io7_ioport_csrs *)IO7_CSRS_KERN(0, 0))->POx_IACK_SPECIAL)))
-
-#ifdef __KERNEL__
-
-/*
- * IO7 structs
- */
-#define IO7_NUM_PORTS 4
-#define IO7_AGP_PORT  3
-
-struct io7_port {
-       struct io7 *io7;
-       struct pci_controller *hose;
-
-       int enabled;
-       unsigned int port;
-       io7_ioport_csrs *csrs;
-
-       unsigned long saved_wbase[4];
-       unsigned long saved_wmask[4];
-       unsigned long saved_tbase[4];
-};
-
-struct io7 {
-       struct io7 *next;
-
-       unsigned int pe;
-       io7_port7_csrs *csrs;
-       struct io7_port ports[IO7_NUM_PORTS];
-
-       spinlock_t irq_lock;
-};
-
-#ifndef __EXTERN_INLINE
-# define __EXTERN_INLINE extern inline
-# define __IO_EXTERN_INLINE
-#endif
-
-/*
- * I/O functions. All access through linear space.
- */
-
-/*
- * Memory functions.  All accesses through linear space.
- */
-
-#define vucp   volatile unsigned char __force *
-#define vusp   volatile unsigned short __force *
-
-extern unsigned int marvel_ioread8(void __iomem *);
-extern void marvel_iowrite8(u8 b, void __iomem *);
-
-__EXTERN_INLINE unsigned int marvel_ioread16(void __iomem *addr)
-{
-       return __kernel_ldwu(*(vusp)addr);
-}
-
-__EXTERN_INLINE void marvel_iowrite16(u16 b, void __iomem *addr)
-{
-       __kernel_stw(b, *(vusp)addr);
-}
-
-extern void __iomem *marvel_ioremap(unsigned long addr, unsigned long size);
-extern void marvel_iounmap(volatile void __iomem *addr);
-extern void __iomem *marvel_ioportmap (unsigned long addr);
-
-__EXTERN_INLINE int marvel_is_ioaddr(unsigned long addr)
-{
-       return (addr >> 40) & 1;
-}
-
-extern int marvel_is_mmio(const volatile void __iomem *);
-
-#undef vucp
-#undef vusp
-
-#undef __IO_PREFIX
-#define __IO_PREFIX            marvel
-#define marvel_trivial_rw_bw   1
-#define marvel_trivial_rw_lq   1
-#define marvel_trivial_io_bw   0
-#define marvel_trivial_io_lq   1
-#define marvel_trivial_iounmap 0
-#include <asm/io_trivial.h>
-
-#ifdef __IO_EXTERN_INLINE
-# undef __EXTERN_INLINE
-# undef __IO_EXTERN_INLINE
-#endif
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_MARVEL__H__ */
diff --git a/include/asm-alpha/core_mcpcia.h b/include/asm-alpha/core_mcpcia.h
deleted file mode 100644 (file)
index acf55b4..0000000
+++ /dev/null
@@ -1,381 +0,0 @@
-#ifndef __ALPHA_MCPCIA__H__
-#define __ALPHA_MCPCIA__H__
-
-/* Define to experiment with fitting everything into one 128MB HAE window.
-   One window per bus, that is.  */
-#define MCPCIA_ONE_HAE_WINDOW 1
-
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <asm/compiler.h>
-
-/*
- * MCPCIA is the internal name for a core logic chipset which provides
- * PCI access for the RAWHIDE family of systems.
- *
- * This file is based on:
- *
- * RAWHIDE System Programmer's Manual
- * 16-May-96
- * Rev. 1.4
- *
- */
-
-/*------------------------------------------------------------------------**
-**                                                                        **
-**  I/O procedures                                                        **
-**                                                                        **
-**      inport[b|w|t|l], outport[b|w|t|l] 8:16:24:32 IO xfers             **
-**     inportbxt: 8 bits only                                            **
-**      inport:    alias of inportw                                       **
-**      outport:   alias of outportw                                      **
-**                                                                        **
-**      inmem[b|w|t|l], outmem[b|w|t|l] 8:16:24:32 ISA memory xfers       **
-**     inmembxt: 8 bits only                                             **
-**      inmem:    alias of inmemw                                         **
-**      outmem:   alias of outmemw                                        **
-**                                                                        **
-**------------------------------------------------------------------------*/
-
-
-/* MCPCIA ADDRESS BIT DEFINITIONS
- *
- *  3333 3333 3322 2222 2222 1111 1111 11
- *  9876 5432 1098 7654 3210 9876 5432 1098 7654 3210
- *  ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
- *  1                                             000
- *  ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
- *  |                                             |\|
- *  |                               Byte Enable --+ |
- *  |                             Transfer Length --+
- *  +-- IO space, not cached
- *
- *   Byte      Transfer
- *   Enable    Length    Transfer  Byte    Address
- *   adr<6:5>  adr<4:3>  Length    Enable  Adder
- *   ---------------------------------------------
- *      00        00      Byte      1110   0x000
- *      01        00      Byte      1101   0x020
- *      10        00      Byte      1011   0x040
- *      11        00      Byte      0111   0x060
- *
- *      00        01      Word      1100   0x008
- *      01        01      Word      1001   0x028 <= Not supported in this code.
- *      10        01      Word      0011   0x048
- *
- *      00        10      Tribyte   1000   0x010
- *      01        10      Tribyte   0001   0x030
- *
- *      10        11      Longword  0000   0x058
- *
- *      Note that byte enables are asserted low.
- *
- */
-
-#define MCPCIA_MAX_HOSES 4
-
-#define MCPCIA_MID(m)          ((unsigned long)(m) << 33)
-
-/* Dodge has PCI0 and PCI1 at MID 4 and 5 respectively. 
-   Durango adds PCI2 and PCI3 at MID 6 and 7 respectively.  */
-#define MCPCIA_HOSE2MID(h)     ((h) + 4)
-
-#define MCPCIA_MEM_MASK 0x07ffffff /* SPARSE Mem region mask is 27 bits */
-
-/*
- * Memory spaces:
- */
-#define MCPCIA_SPARSE(m)       (IDENT_ADDR + 0xf000000000UL + MCPCIA_MID(m))
-#define MCPCIA_DENSE(m)                (IDENT_ADDR + 0xf100000000UL + MCPCIA_MID(m))
-#define MCPCIA_IO(m)           (IDENT_ADDR + 0xf180000000UL + MCPCIA_MID(m))
-#define MCPCIA_CONF(m)         (IDENT_ADDR + 0xf1c0000000UL + MCPCIA_MID(m))
-#define MCPCIA_CSR(m)          (IDENT_ADDR + 0xf1e0000000UL + MCPCIA_MID(m))
-#define MCPCIA_IO_IACK(m)      (IDENT_ADDR + 0xf1f0000000UL + MCPCIA_MID(m))
-#define MCPCIA_DENSE_IO(m)     (IDENT_ADDR + 0xe1fc000000UL + MCPCIA_MID(m))
-#define MCPCIA_DENSE_CONF(m)   (IDENT_ADDR + 0xe1fe000000UL + MCPCIA_MID(m))
-
-/*
- *  General Registers
- */
-#define MCPCIA_REV(m)          (MCPCIA_CSR(m) + 0x000)
-#define MCPCIA_WHOAMI(m)       (MCPCIA_CSR(m) + 0x040)
-#define MCPCIA_PCI_LAT(m)      (MCPCIA_CSR(m) + 0x080)
-#define MCPCIA_CAP_CTRL(m)     (MCPCIA_CSR(m) + 0x100)
-#define MCPCIA_HAE_MEM(m)      (MCPCIA_CSR(m) + 0x400)
-#define MCPCIA_HAE_IO(m)       (MCPCIA_CSR(m) + 0x440)
-#define _MCPCIA_IACK_SC(m)     (MCPCIA_CSR(m) + 0x480)
-#define MCPCIA_HAE_DENSE(m)    (MCPCIA_CSR(m) + 0x4C0)
-
-/*
- * Interrupt Control registers
- */
-#define MCPCIA_INT_CTL(m)      (MCPCIA_CSR(m) + 0x500)
-#define MCPCIA_INT_REQ(m)      (MCPCIA_CSR(m) + 0x540)
-#define MCPCIA_INT_TARG(m)     (MCPCIA_CSR(m) + 0x580)
-#define MCPCIA_INT_ADR(m)      (MCPCIA_CSR(m) + 0x5C0)
-#define MCPCIA_INT_ADR_EXT(m)  (MCPCIA_CSR(m) + 0x600)
-#define MCPCIA_INT_MASK0(m)    (MCPCIA_CSR(m) + 0x640)
-#define MCPCIA_INT_MASK1(m)    (MCPCIA_CSR(m) + 0x680)
-#define MCPCIA_INT_ACK0(m)     (MCPCIA_CSR(m) + 0x10003f00)
-#define MCPCIA_INT_ACK1(m)     (MCPCIA_CSR(m) + 0x10003f40)
-
-/*
- * Performance Monitor registers
- */
-#define MCPCIA_PERF_MON(m)     (MCPCIA_CSR(m) + 0x300)
-#define MCPCIA_PERF_CONT(m)    (MCPCIA_CSR(m) + 0x340)
-
-/*
- * Diagnostic Registers
- */
-#define MCPCIA_CAP_DIAG(m)     (MCPCIA_CSR(m) + 0x700)
-#define MCPCIA_TOP_OF_MEM(m)   (MCPCIA_CSR(m) + 0x7C0)
-
-/*
- * Error registers
- */
-#define MCPCIA_MC_ERR0(m)      (MCPCIA_CSR(m) + 0x800)
-#define MCPCIA_MC_ERR1(m)      (MCPCIA_CSR(m) + 0x840)
-#define MCPCIA_CAP_ERR(m)      (MCPCIA_CSR(m) + 0x880)
-#define MCPCIA_PCI_ERR1(m)     (MCPCIA_CSR(m) + 0x1040)
-#define MCPCIA_MDPA_STAT(m)    (MCPCIA_CSR(m) + 0x4000)
-#define MCPCIA_MDPA_SYN(m)     (MCPCIA_CSR(m) + 0x4040)
-#define MCPCIA_MDPA_DIAG(m)    (MCPCIA_CSR(m) + 0x4080)
-#define MCPCIA_MDPB_STAT(m)    (MCPCIA_CSR(m) + 0x8000)
-#define MCPCIA_MDPB_SYN(m)     (MCPCIA_CSR(m) + 0x8040)
-#define MCPCIA_MDPB_DIAG(m)    (MCPCIA_CSR(m) + 0x8080)
-
-/*
- * PCI Address Translation Registers.
- */
-#define MCPCIA_SG_TBIA(m)      (MCPCIA_CSR(m) + 0x1300)
-#define MCPCIA_HBASE(m)                (MCPCIA_CSR(m) + 0x1340)
-
-#define MCPCIA_W0_BASE(m)      (MCPCIA_CSR(m) + 0x1400)
-#define MCPCIA_W0_MASK(m)      (MCPCIA_CSR(m) + 0x1440)
-#define MCPCIA_T0_BASE(m)      (MCPCIA_CSR(m) + 0x1480)
-
-#define MCPCIA_W1_BASE(m)      (MCPCIA_CSR(m) + 0x1500)
-#define MCPCIA_W1_MASK(m)      (MCPCIA_CSR(m) + 0x1540)
-#define MCPCIA_T1_BASE(m)      (MCPCIA_CSR(m) + 0x1580)
-
-#define MCPCIA_W2_BASE(m)      (MCPCIA_CSR(m) + 0x1600)
-#define MCPCIA_W2_MASK(m)      (MCPCIA_CSR(m) + 0x1640)
-#define MCPCIA_T2_BASE(m)      (MCPCIA_CSR(m) + 0x1680)
-
-#define MCPCIA_W3_BASE(m)      (MCPCIA_CSR(m) + 0x1700)
-#define MCPCIA_W3_MASK(m)      (MCPCIA_CSR(m) + 0x1740)
-#define MCPCIA_T3_BASE(m)      (MCPCIA_CSR(m) + 0x1780)
-
-/* Hack!  Only words for bus 0.  */
-
-#ifndef MCPCIA_ONE_HAE_WINDOW
-#define MCPCIA_HAE_ADDRESS     MCPCIA_HAE_MEM(4)
-#endif
-#define MCPCIA_IACK_SC         _MCPCIA_IACK_SC(4)
-
-/* 
- * The canonical non-remaped I/O and MEM addresses have these values
- * subtracted out.  This is arranged so that folks manipulating ISA
- * devices can use their familiar numbers and have them map to bus 0.
- */
-
-#define MCPCIA_IO_BIAS         MCPCIA_IO(4)
-#define MCPCIA_MEM_BIAS                MCPCIA_DENSE(4)
-
-/* Offset between ram physical addresses and pci64 DAC bus addresses.  */
-#define MCPCIA_DAC_OFFSET      (1UL << 40)
-
-/*
- * Data structure for handling MCPCIA machine checks:
- */
-struct el_MCPCIA_uncorrected_frame_mcheck {
-       struct el_common header;
-       struct el_common_EV5_uncorrectable_mcheck procdata;
-};
-
-
-#ifdef __KERNEL__
-
-#ifndef __EXTERN_INLINE
-#define __EXTERN_INLINE extern inline
-#define __IO_EXTERN_INLINE
-#endif
-
-/*
- * I/O functions:
- *
- * MCPCIA, the RAWHIDE family PCI/memory support chipset for the EV5 (21164)
- * and EV56 (21164a) processors, can use either a sparse address mapping
- * scheme, or the so-called byte-word PCI address space, to get at PCI memory
- * and I/O.
- *
- * Unfortunately, we can't use BWIO with EV5, so for now, we always use SPARSE.
- */
-
-/*
- * Memory functions.  64-bit and 32-bit accesses are done through
- * dense memory space, everything else through sparse space.
- *
- * For reading and writing 8 and 16 bit quantities we need to
- * go through one of the three sparse address mapping regions
- * and use the HAE_MEM CSR to provide some bits of the address.
- * The following few routines use only sparse address region 1
- * which gives 1Gbyte of accessible space which relates exactly
- * to the amount of PCI memory mapping *into* system address space.
- * See p 6-17 of the specification but it looks something like this:
- *
- * 21164 Address:
- *
- *          3         2         1
- * 9876543210987654321098765432109876543210
- * 1ZZZZ0.PCI.QW.Address............BBLL
- *
- * ZZ = SBZ
- * BB = Byte offset
- * LL = Transfer length
- *
- * PCI Address:
- *
- * 3         2         1
- * 10987654321098765432109876543210
- * HHH....PCI.QW.Address........ 00
- *
- * HHH = 31:29 HAE_MEM CSR
- *
- */
-
-#define vip    volatile int __force *
-#define vuip   volatile unsigned int __force *
-
-#ifdef MCPCIA_ONE_HAE_WINDOW
-#define MCPCIA_FROB_MMIO                                               \
-       if (__mcpcia_is_mmio(hose)) {                                   \
-               set_hae(hose & 0xffffffff);                             \
-               hose = hose - MCPCIA_DENSE(4) + MCPCIA_SPARSE(4);       \
-       }
-#else
-#define MCPCIA_FROB_MMIO                                               \
-       if (__mcpcia_is_mmio(hose)) {                                   \
-               hose = hose - MCPCIA_DENSE(4) + MCPCIA_SPARSE(4);       \
-       }
-#endif
-
-extern inline int __mcpcia_is_mmio(unsigned long addr)
-{
-       return (addr & 0x80000000UL) == 0;
-}
-
-__EXTERN_INLINE unsigned int mcpcia_ioread8(void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long)xaddr & MCPCIA_MEM_MASK;
-       unsigned long hose = (unsigned long)xaddr & ~MCPCIA_MEM_MASK;
-       unsigned long result;
-
-       MCPCIA_FROB_MMIO;
-
-       result = *(vip) ((addr << 5) + hose + 0x00);
-       return __kernel_extbl(result, addr & 3);
-}
-
-__EXTERN_INLINE void mcpcia_iowrite8(u8 b, void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long)xaddr & MCPCIA_MEM_MASK;
-       unsigned long hose = (unsigned long)xaddr & ~MCPCIA_MEM_MASK;
-       unsigned long w;
-
-       MCPCIA_FROB_MMIO;
-
-       w = __kernel_insbl(b, addr & 3);
-       *(vuip) ((addr << 5) + hose + 0x00) = w;
-}
-
-__EXTERN_INLINE unsigned int mcpcia_ioread16(void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long)xaddr & MCPCIA_MEM_MASK;
-       unsigned long hose = (unsigned long)xaddr & ~MCPCIA_MEM_MASK;
-       unsigned long result;
-
-       MCPCIA_FROB_MMIO;
-
-       result = *(vip) ((addr << 5) + hose + 0x08);
-       return __kernel_extwl(result, addr & 3);
-}
-
-__EXTERN_INLINE void mcpcia_iowrite16(u16 b, void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long)xaddr & MCPCIA_MEM_MASK;
-       unsigned long hose = (unsigned long)xaddr & ~MCPCIA_MEM_MASK;
-       unsigned long w;
-
-       MCPCIA_FROB_MMIO;
-
-       w = __kernel_inswl(b, addr & 3);
-       *(vuip) ((addr << 5) + hose + 0x08) = w;
-}
-
-__EXTERN_INLINE unsigned int mcpcia_ioread32(void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long)xaddr;
-
-       if (!__mcpcia_is_mmio(addr))
-               addr = ((addr & 0xffff) << 5) + (addr & ~0xfffful) + 0x18;
-
-       return *(vuip)addr;
-}
-
-__EXTERN_INLINE void mcpcia_iowrite32(u32 b, void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long)xaddr;
-
-       if (!__mcpcia_is_mmio(addr))
-               addr = ((addr & 0xffff) << 5) + (addr & ~0xfffful) + 0x18;
-
-       *(vuip)addr = b;
-}
-
-
-__EXTERN_INLINE void __iomem *mcpcia_ioportmap(unsigned long addr)
-{
-       return (void __iomem *)(addr + MCPCIA_IO_BIAS);
-}
-
-__EXTERN_INLINE void __iomem *mcpcia_ioremap(unsigned long addr,
-                                            unsigned long size)
-{
-       return (void __iomem *)(addr + MCPCIA_MEM_BIAS);
-}
-
-__EXTERN_INLINE int mcpcia_is_ioaddr(unsigned long addr)
-{
-       return addr >= MCPCIA_SPARSE(0);
-}
-
-__EXTERN_INLINE int mcpcia_is_mmio(const volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       return __mcpcia_is_mmio(addr);
-}
-
-#undef MCPCIA_FROB_MMIO
-
-#undef vip
-#undef vuip
-
-#undef __IO_PREFIX
-#define __IO_PREFIX            mcpcia
-#define mcpcia_trivial_rw_bw   2
-#define mcpcia_trivial_rw_lq   1
-#define mcpcia_trivial_io_bw   0
-#define mcpcia_trivial_io_lq   0
-#define mcpcia_trivial_iounmap 1
-#include <asm/io_trivial.h>
-
-#ifdef __IO_EXTERN_INLINE
-#undef __EXTERN_INLINE
-#undef __IO_EXTERN_INLINE
-#endif
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_MCPCIA__H__ */
diff --git a/include/asm-alpha/core_polaris.h b/include/asm-alpha/core_polaris.h
deleted file mode 100644 (file)
index 2f966b6..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-#ifndef __ALPHA_POLARIS__H__
-#define __ALPHA_POLARIS__H__
-
-#include <linux/types.h>
-#include <asm/compiler.h>
-
-/*
- * POLARIS is the internal name for a core logic chipset which provides
- * memory controller and PCI access for the 21164PC chip based systems.
- *
- * This file is based on:
- *
- * Polaris System Controller
- * Device Functional Specification
- * 22-Jan-98
- * Rev. 4.2
- *
- */
-
-/* Polaris memory regions */
-#define POLARIS_SPARSE_MEM_BASE                (IDENT_ADDR + 0xf800000000UL)
-#define POLARIS_DENSE_MEM_BASE         (IDENT_ADDR + 0xf900000000UL)
-#define POLARIS_SPARSE_IO_BASE         (IDENT_ADDR + 0xf980000000UL)
-#define POLARIS_SPARSE_CONFIG_BASE     (IDENT_ADDR + 0xf9c0000000UL)
-#define POLARIS_IACK_BASE              (IDENT_ADDR + 0xf9f8000000UL)
-#define POLARIS_DENSE_IO_BASE          (IDENT_ADDR + 0xf9fc000000UL)
-#define POLARIS_DENSE_CONFIG_BASE      (IDENT_ADDR + 0xf9fe000000UL)
-
-#define POLARIS_IACK_SC                        POLARIS_IACK_BASE
-
-/* The Polaris command/status registers live in PCI Config space for
- * bus 0/device 0.  As such, they may be bytes, words, or doublewords.
- */
-#define POLARIS_W_VENID                (POLARIS_DENSE_CONFIG_BASE)
-#define POLARIS_W_DEVID                (POLARIS_DENSE_CONFIG_BASE+2)
-#define POLARIS_W_CMD          (POLARIS_DENSE_CONFIG_BASE+4)
-#define POLARIS_W_STATUS       (POLARIS_DENSE_CONFIG_BASE+6)
-
-/*
- * Data structure for handling POLARIS machine checks:
- */
-struct el_POLARIS_sysdata_mcheck {
-    u_long      psc_status;
-    u_long     psc_pcictl0;
-    u_long     psc_pcictl1;
-    u_long     psc_pcictl2;
-};
-
-#ifdef __KERNEL__
-
-#ifndef __EXTERN_INLINE
-#define __EXTERN_INLINE extern inline
-#define __IO_EXTERN_INLINE
-#endif
-
-/*
- * I/O functions:
- *
- * POLARIS, the PCI/memory support chipset for the PCA56 (21164PC)
- * processors, can use either a sparse address  mapping scheme, or the 
- * so-called byte-word PCI address space, to get at PCI memory and I/O.
- *
- * However, we will support only the BWX form.
- */
-
-/*
- * Memory functions.  Polaris allows all accesses (byte/word
- * as well as long/quad) to be done through dense space.
- *
- * We will only support DENSE access via BWX insns.
- */
-
-__EXTERN_INLINE void __iomem *polaris_ioportmap(unsigned long addr)
-{
-       return (void __iomem *)(addr + POLARIS_DENSE_IO_BASE);
-}
-
-__EXTERN_INLINE void __iomem *polaris_ioremap(unsigned long addr,
-                                             unsigned long size)
-{
-       return (void __iomem *)(addr + POLARIS_DENSE_MEM_BASE);
-}
-
-__EXTERN_INLINE int polaris_is_ioaddr(unsigned long addr)
-{
-       return addr >= POLARIS_SPARSE_MEM_BASE;
-}
-
-__EXTERN_INLINE int polaris_is_mmio(const volatile void __iomem *addr)
-{
-       return (unsigned long)addr < POLARIS_SPARSE_IO_BASE;
-}
-
-#undef __IO_PREFIX
-#define __IO_PREFIX            polaris
-#define polaris_trivial_rw_bw  1
-#define polaris_trivial_rw_lq  1
-#define polaris_trivial_io_bw  1
-#define polaris_trivial_io_lq  1
-#define polaris_trivial_iounmap        1
-#include <asm/io_trivial.h>
-
-#ifdef __IO_EXTERN_INLINE
-#undef __EXTERN_INLINE
-#undef __IO_EXTERN_INLINE
-#endif
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_POLARIS__H__ */
diff --git a/include/asm-alpha/core_t2.h b/include/asm-alpha/core_t2.h
deleted file mode 100644 (file)
index 46bfff5..0000000
+++ /dev/null
@@ -1,633 +0,0 @@
-#ifndef __ALPHA_T2__H__
-#define __ALPHA_T2__H__
-
-#include <linux/types.h>
-#include <linux/spinlock.h>
-#include <asm/compiler.h>
-#include <asm/system.h>
-
-/*
- * T2 is the internal name for the core logic chipset which provides
- * memory controller and PCI access for the SABLE-based systems.
- *
- * This file is based on:
- *
- * SABLE I/O Specification
- * Revision/Update Information: 1.3
- *
- * jestabro@amt.tay1.dec.com Initial Version.
- *
- */
-
-#define T2_MEM_R1_MASK 0x07ffffff  /* Mem sparse region 1 mask is 26 bits */
-
-/* GAMMA-SABLE is a SABLE with EV5-based CPUs */
-/* All LYNX machines, EV4 or EV5, use the GAMMA bias also */
-#define _GAMMA_BIAS            0x8000000000UL
-
-#if defined(CONFIG_ALPHA_GENERIC)
-#define GAMMA_BIAS             alpha_mv.sys.t2.gamma_bias
-#elif defined(CONFIG_ALPHA_GAMMA)
-#define GAMMA_BIAS             _GAMMA_BIAS
-#else
-#define GAMMA_BIAS             0
-#endif
-
-/*
- * Memory spaces:
- */
-#define T2_CONF                        (IDENT_ADDR + GAMMA_BIAS + 0x390000000UL)
-#define T2_IO                  (IDENT_ADDR + GAMMA_BIAS + 0x3a0000000UL)
-#define T2_SPARSE_MEM          (IDENT_ADDR + GAMMA_BIAS + 0x200000000UL)
-#define T2_DENSE_MEM           (IDENT_ADDR + GAMMA_BIAS + 0x3c0000000UL)
-
-#define T2_IOCSR               (IDENT_ADDR + GAMMA_BIAS + 0x38e000000UL)
-#define T2_CERR1               (IDENT_ADDR + GAMMA_BIAS + 0x38e000020UL)
-#define T2_CERR2               (IDENT_ADDR + GAMMA_BIAS + 0x38e000040UL)
-#define T2_CERR3               (IDENT_ADDR + GAMMA_BIAS + 0x38e000060UL)
-#define T2_PERR1               (IDENT_ADDR + GAMMA_BIAS + 0x38e000080UL)
-#define T2_PERR2               (IDENT_ADDR + GAMMA_BIAS + 0x38e0000a0UL)
-#define T2_PSCR                        (IDENT_ADDR + GAMMA_BIAS + 0x38e0000c0UL)
-#define T2_HAE_1               (IDENT_ADDR + GAMMA_BIAS + 0x38e0000e0UL)
-#define T2_HAE_2               (IDENT_ADDR + GAMMA_BIAS + 0x38e000100UL)
-#define T2_HBASE               (IDENT_ADDR + GAMMA_BIAS + 0x38e000120UL)
-#define T2_WBASE1              (IDENT_ADDR + GAMMA_BIAS + 0x38e000140UL)
-#define T2_WMASK1              (IDENT_ADDR + GAMMA_BIAS + 0x38e000160UL)
-#define T2_TBASE1              (IDENT_ADDR + GAMMA_BIAS + 0x38e000180UL)
-#define T2_WBASE2              (IDENT_ADDR + GAMMA_BIAS + 0x38e0001a0UL)
-#define T2_WMASK2              (IDENT_ADDR + GAMMA_BIAS + 0x38e0001c0UL)
-#define T2_TBASE2              (IDENT_ADDR + GAMMA_BIAS + 0x38e0001e0UL)
-#define T2_TLBBR               (IDENT_ADDR + GAMMA_BIAS + 0x38e000200UL)
-#define T2_IVR                 (IDENT_ADDR + GAMMA_BIAS + 0x38e000220UL)
-#define T2_HAE_3               (IDENT_ADDR + GAMMA_BIAS + 0x38e000240UL)
-#define T2_HAE_4               (IDENT_ADDR + GAMMA_BIAS + 0x38e000260UL)
-
-/* The CSRs below are T3/T4 only */
-#define T2_WBASE3              (IDENT_ADDR + GAMMA_BIAS + 0x38e000280UL)
-#define T2_WMASK3              (IDENT_ADDR + GAMMA_BIAS + 0x38e0002a0UL)
-#define T2_TBASE3              (IDENT_ADDR + GAMMA_BIAS + 0x38e0002c0UL)
-
-#define T2_TDR0                        (IDENT_ADDR + GAMMA_BIAS + 0x38e000300UL)
-#define T2_TDR1                        (IDENT_ADDR + GAMMA_BIAS + 0x38e000320UL)
-#define T2_TDR2                        (IDENT_ADDR + GAMMA_BIAS + 0x38e000340UL)
-#define T2_TDR3                        (IDENT_ADDR + GAMMA_BIAS + 0x38e000360UL)
-#define T2_TDR4                        (IDENT_ADDR + GAMMA_BIAS + 0x38e000380UL)
-#define T2_TDR5                        (IDENT_ADDR + GAMMA_BIAS + 0x38e0003a0UL)
-#define T2_TDR6                        (IDENT_ADDR + GAMMA_BIAS + 0x38e0003c0UL)
-#define T2_TDR7                        (IDENT_ADDR + GAMMA_BIAS + 0x38e0003e0UL)
-
-#define T2_WBASE4              (IDENT_ADDR + GAMMA_BIAS + 0x38e000400UL)
-#define T2_WMASK4              (IDENT_ADDR + GAMMA_BIAS + 0x38e000420UL)
-#define T2_TBASE4              (IDENT_ADDR + GAMMA_BIAS + 0x38e000440UL)
-
-#define T2_AIR                 (IDENT_ADDR + GAMMA_BIAS + 0x38e000460UL)
-#define T2_VAR                 (IDENT_ADDR + GAMMA_BIAS + 0x38e000480UL)
-#define T2_DIR                 (IDENT_ADDR + GAMMA_BIAS + 0x38e0004a0UL)
-#define T2_ICE                 (IDENT_ADDR + GAMMA_BIAS + 0x38e0004c0UL)
-
-#define T2_HAE_ADDRESS         T2_HAE_1
-
-/*  T2 CSRs are in the non-cachable primary IO space from 3.8000.0000 to
- 3.8fff.ffff
- *
- *  +--------------+ 3 8000 0000
- *  | CPU 0 CSRs   |
- *  +--------------+ 3 8100 0000
- *  | CPU 1 CSRs   |
- *  +--------------+ 3 8200 0000
- *  | CPU 2 CSRs   |
- *  +--------------+ 3 8300 0000
- *  | CPU 3 CSRs   |
- *  +--------------+ 3 8400 0000
- *  | CPU Reserved |
- *  +--------------+ 3 8700 0000
- *  | Mem Reserved |
- *  +--------------+ 3 8800 0000
- *  | Mem 0 CSRs   |
- *  +--------------+ 3 8900 0000
- *  | Mem 1 CSRs   |
- *  +--------------+ 3 8a00 0000
- *  | Mem 2 CSRs   |
- *  +--------------+ 3 8b00 0000
- *  | Mem 3 CSRs   |
- *  +--------------+ 3 8c00 0000
- *  | Mem Reserved |
- *  +--------------+ 3 8e00 0000
- *  | PCI Bridge   |
- *  +--------------+ 3 8f00 0000
- *  | Expansion IO |
- *  +--------------+ 3 9000 0000
- *
- *
- */
-#define T2_CPU0_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x380000000L)
-#define T2_CPU1_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x381000000L)
-#define T2_CPU2_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x382000000L)
-#define T2_CPU3_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x383000000L)
-
-#define T2_CPUn_BASE(n)                (T2_CPU0_BASE + (((n)&3) * 0x001000000L))
-
-#define T2_MEM0_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x388000000L)
-#define T2_MEM1_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x389000000L)
-#define T2_MEM2_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x38a000000L)
-#define T2_MEM3_BASE            (IDENT_ADDR + GAMMA_BIAS + 0x38b000000L)
-
-
-/*
- * Sable CPU Module CSRS
- *
- * These are CSRs for hardware other than the CPU chip on the CPU module.
- * The CPU module has Backup Cache control logic, Cbus control logic, and
- * interrupt control logic on it.  There is a duplicate tag store to speed
- * up maintaining cache coherency.
- */
-
-struct sable_cpu_csr {
-  unsigned long bcc;     long fill_00[3]; /* Backup Cache Control */
-  unsigned long bcce;    long fill_01[3]; /* Backup Cache Correctable Error */
-  unsigned long bccea;   long fill_02[3]; /* B-Cache Corr Err Address Latch */
-  unsigned long bcue;    long fill_03[3]; /* B-Cache Uncorrectable Error */
-  unsigned long bcuea;   long fill_04[3]; /* B-Cache Uncorr Err Addr Latch */
-  unsigned long dter;    long fill_05[3]; /* Duplicate Tag Error */
-  unsigned long cbctl;   long fill_06[3]; /* CBus Control */
-  unsigned long cbe;     long fill_07[3]; /* CBus Error */
-  unsigned long cbeal;   long fill_08[3]; /* CBus Error Addr Latch low */
-  unsigned long cbeah;   long fill_09[3]; /* CBus Error Addr Latch high */
-  unsigned long pmbx;    long fill_10[3]; /* Processor Mailbox */
-  unsigned long ipir;    long fill_11[3]; /* Inter-Processor Int Request */
-  unsigned long sic;     long fill_12[3]; /* System Interrupt Clear */
-  unsigned long adlk;    long fill_13[3]; /* Address Lock (LDxL/STxC) */
-  unsigned long madrl;   long fill_14[3]; /* CBus Miss Address */
-  unsigned long rev;     long fill_15[3]; /* CMIC Revision */
-};
-
-/*
- * Data structure for handling T2 machine checks:
- */
-struct el_t2_frame_header {
-       unsigned int    elcf_fid;       /* Frame ID (from above) */
-       unsigned int    elcf_size;      /* Size of frame in bytes */
-};
-
-struct el_t2_procdata_mcheck {
-       unsigned long   elfmc_paltemp[32];      /* PAL TEMP REGS. */
-       /* EV4-specific fields */
-       unsigned long   elfmc_exc_addr; /* Addr of excepting insn. */
-       unsigned long   elfmc_exc_sum;  /* Summary of arith traps. */
-       unsigned long   elfmc_exc_mask; /* Exception mask (from exc_sum). */
-       unsigned long   elfmc_iccsr;    /* IBox hardware enables. */
-       unsigned long   elfmc_pal_base; /* Base address for PALcode. */
-       unsigned long   elfmc_hier;     /* Hardware Interrupt Enable. */
-       unsigned long   elfmc_hirr;     /* Hardware Interrupt Request. */
-       unsigned long   elfmc_mm_csr;   /* D-stream fault info. */
-       unsigned long   elfmc_dc_stat;  /* D-cache status (ECC/Parity Err). */
-       unsigned long   elfmc_dc_addr;  /* EV3 Phys Addr for ECC/DPERR. */
-       unsigned long   elfmc_abox_ctl; /* ABox Control Register. */
-       unsigned long   elfmc_biu_stat; /* BIU Status. */
-       unsigned long   elfmc_biu_addr; /* BUI Address. */
-       unsigned long   elfmc_biu_ctl;  /* BIU Control. */
-       unsigned long   elfmc_fill_syndrome; /* For correcting ECC errors. */
-       unsigned long   elfmc_fill_addr;/* Cache block which was being read. */
-       unsigned long   elfmc_va;       /* Effective VA of fault or miss. */
-       unsigned long   elfmc_bc_tag;   /* Backup Cache Tag Probe Results. */
-};
-
-/*
- * Sable processor specific Machine Check Data segment.
- */
-
-struct el_t2_logout_header {
-       unsigned int    elfl_size;      /* size in bytes of logout area. */
-       unsigned int    elfl_sbz1:31;   /* Should be zero. */
-       unsigned int    elfl_retry:1;   /* Retry flag. */
-       unsigned int    elfl_procoffset; /* Processor-specific offset. */
-       unsigned int    elfl_sysoffset;  /* Offset of system-specific. */
-       unsigned int    elfl_error_type;        /* PAL error type code. */
-       unsigned int    elfl_frame_rev;         /* PAL Frame revision. */
-};
-struct el_t2_sysdata_mcheck {
-       unsigned long    elcmc_bcc;           /* CSR 0 */
-       unsigned long    elcmc_bcce;          /* CSR 1 */
-       unsigned long    elcmc_bccea;      /* CSR 2 */
-       unsigned long    elcmc_bcue;          /* CSR 3 */
-       unsigned long    elcmc_bcuea;      /* CSR 4 */
-       unsigned long    elcmc_dter;          /* CSR 5 */
-       unsigned long    elcmc_cbctl;      /* CSR 6 */
-       unsigned long    elcmc_cbe;           /* CSR 7 */
-       unsigned long    elcmc_cbeal;      /* CSR 8 */
-       unsigned long    elcmc_cbeah;      /* CSR 9 */
-       unsigned long    elcmc_pmbx;          /* CSR 10 */
-       unsigned long    elcmc_ipir;          /* CSR 11 */
-       unsigned long    elcmc_sic;           /* CSR 12 */
-       unsigned long    elcmc_adlk;          /* CSR 13 */
-       unsigned long    elcmc_madrl;      /* CSR 14 */
-       unsigned long    elcmc_crrev4;     /* CSR 15 */
-};
-
-/*
- * Sable memory error frame - sable pfms section 3.42
- */
-struct el_t2_data_memory {
-       struct  el_t2_frame_header elcm_hdr;    /* ID$MEM-FERR = 0x08 */
-       unsigned int  elcm_module;      /* Module id. */
-       unsigned int  elcm_res04;       /* Reserved. */
-       unsigned long elcm_merr;        /* CSR0: Error Reg 1. */
-       unsigned long elcm_mcmd1;       /* CSR1: Command Trap 1. */
-       unsigned long elcm_mcmd2;       /* CSR2: Command Trap 2. */
-       unsigned long elcm_mconf;       /* CSR3: Configuration. */
-       unsigned long elcm_medc1;       /* CSR4: EDC Status 1. */
-       unsigned long elcm_medc2;       /* CSR5: EDC Status 2. */
-       unsigned long elcm_medcc;       /* CSR6: EDC Control. */
-       unsigned long elcm_msctl;       /* CSR7: Stream Buffer Control. */
-       unsigned long elcm_mref;        /* CSR8: Refresh Control. */
-       unsigned long elcm_filter;      /* CSR9: CRD Filter Control. */
-};
-
-
-/*
- * Sable other CPU error frame - sable pfms section 3.43
- */
-struct el_t2_data_other_cpu {
-       short         elco_cpuid;       /* CPU ID */
-       short         elco_res02[3];
-       unsigned long elco_bcc; /* CSR 0 */
-       unsigned long elco_bcce;        /* CSR 1 */
-       unsigned long elco_bccea;       /* CSR 2 */
-       unsigned long elco_bcue;        /* CSR 3 */
-       unsigned long elco_bcuea;       /* CSR 4 */
-       unsigned long elco_dter;        /* CSR 5 */
-       unsigned long elco_cbctl;       /* CSR 6 */
-       unsigned long elco_cbe; /* CSR 7 */
-       unsigned long elco_cbeal;       /* CSR 8 */
-       unsigned long elco_cbeah;       /* CSR 9 */
-       unsigned long elco_pmbx;        /* CSR 10 */
-       unsigned long elco_ipir;        /* CSR 11 */
-       unsigned long elco_sic; /* CSR 12 */
-       unsigned long elco_adlk;        /* CSR 13 */
-       unsigned long elco_madrl;       /* CSR 14 */
-       unsigned long elco_crrev4;      /* CSR 15 */
-};
-
-/*
- * Sable other CPU error frame - sable pfms section 3.44
- */
-struct el_t2_data_t2{
-       struct el_t2_frame_header elct_hdr;     /* ID$T2-FRAME */
-       unsigned long elct_iocsr;       /* IO Control and Status Register */
-       unsigned long elct_cerr1;       /* Cbus Error Register 1 */
-       unsigned long elct_cerr2;       /* Cbus Error Register 2 */
-       unsigned long elct_cerr3;       /* Cbus Error Register 3 */
-       unsigned long elct_perr1;       /* PCI Error Register 1 */
-       unsigned long elct_perr2;       /* PCI Error Register 2 */
-       unsigned long elct_hae0_1;      /* High Address Extension Register 1 */
-       unsigned long elct_hae0_2;      /* High Address Extension Register 2 */
-       unsigned long elct_hbase;       /* High Base Register */
-       unsigned long elct_wbase1;      /* Window Base Register 1 */
-       unsigned long elct_wmask1;      /* Window Mask Register 1 */
-       unsigned long elct_tbase1;      /* Translated Base Register 1 */
-       unsigned long elct_wbase2;      /* Window Base Register 2 */
-       unsigned long elct_wmask2;      /* Window Mask Register 2 */
-       unsigned long elct_tbase2;      /* Translated Base Register 2 */
-       unsigned long elct_tdr0;        /* TLB Data Register 0 */
-       unsigned long elct_tdr1;        /* TLB Data Register 1 */
-       unsigned long elct_tdr2;        /* TLB Data Register 2 */
-       unsigned long elct_tdr3;        /* TLB Data Register 3 */
-       unsigned long elct_tdr4;        /* TLB Data Register 4 */
-       unsigned long elct_tdr5;        /* TLB Data Register 5 */
-       unsigned long elct_tdr6;        /* TLB Data Register 6 */
-       unsigned long elct_tdr7;        /* TLB Data Register 7 */
-};
-
-/*
- * Sable error log data structure - sable pfms section 3.40
- */
-struct el_t2_data_corrected {
-       unsigned long elcpb_biu_stat;
-       unsigned long elcpb_biu_addr;
-       unsigned long elcpb_biu_ctl;
-       unsigned long elcpb_fill_syndrome;
-       unsigned long elcpb_fill_addr;
-       unsigned long elcpb_bc_tag;
-};
-
-/*
- * Sable error log data structure
- * Note there are 4 memory slots on sable (see t2.h)
- */
-struct el_t2_frame_mcheck {
-       struct el_t2_frame_header elfmc_header; /* ID$P-FRAME_MCHECK */
-       struct el_t2_logout_header elfmc_hdr;
-       struct el_t2_procdata_mcheck elfmc_procdata;
-       struct el_t2_sysdata_mcheck elfmc_sysdata;
-       struct el_t2_data_t2 elfmc_t2data;
-       struct el_t2_data_memory elfmc_memdata[4];
-       struct el_t2_frame_header elfmc_footer; /* empty */
-};
-
-
-/*
- * Sable error log data structures on memory errors
- */
-struct el_t2_frame_corrected {
-       struct el_t2_frame_header elfcc_header; /* ID$P-BC-COR */
-       struct el_t2_logout_header elfcc_hdr;
-       struct el_t2_data_corrected elfcc_procdata;
-/*     struct el_t2_data_t2 elfcc_t2data;              */
-/*     struct el_t2_data_memory elfcc_memdata[4];      */
-       struct el_t2_frame_header elfcc_footer; /* empty */
-};
-
-
-#ifdef __KERNEL__
-
-#ifndef __EXTERN_INLINE
-#define __EXTERN_INLINE extern inline
-#define __IO_EXTERN_INLINE
-#endif
-
-/*
- * I/O functions:
- *
- * T2 (the core logic PCI/memory support chipset for the SABLE
- * series of processors uses a sparse address mapping scheme to
- * get at PCI memory and I/O.
- */
-
-#define vip    volatile int *
-#define vuip   volatile unsigned int *
-
-extern inline u8 t2_inb(unsigned long addr)
-{
-       long result = *(vip) ((addr << 5) + T2_IO + 0x00);
-       return __kernel_extbl(result, addr & 3);
-}
-
-extern inline void t2_outb(u8 b, unsigned long addr)
-{
-       unsigned long w;
-
-       w = __kernel_insbl(b, addr & 3);
-       *(vuip) ((addr << 5) + T2_IO + 0x00) = w;
-       mb();
-}
-
-extern inline u16 t2_inw(unsigned long addr)
-{
-       long result = *(vip) ((addr << 5) + T2_IO + 0x08);
-       return __kernel_extwl(result, addr & 3);
-}
-
-extern inline void t2_outw(u16 b, unsigned long addr)
-{
-       unsigned long w;
-
-       w = __kernel_inswl(b, addr & 3);
-       *(vuip) ((addr << 5) + T2_IO + 0x08) = w;
-       mb();
-}
-
-extern inline u32 t2_inl(unsigned long addr)
-{
-       return *(vuip) ((addr << 5) + T2_IO + 0x18);
-}
-
-extern inline void t2_outl(u32 b, unsigned long addr)
-{
-       *(vuip) ((addr << 5) + T2_IO + 0x18) = b;
-       mb();
-}
-
-
-/*
- * Memory functions.
- *
- * For reading and writing 8 and 16 bit quantities we need to
- * go through one of the three sparse address mapping regions
- * and use the HAE_MEM CSR to provide some bits of the address.
- * The following few routines use only sparse address region 1
- * which gives 1Gbyte of accessible space which relates exactly
- * to the amount of PCI memory mapping *into* system address space.
- * See p 6-17 of the specification but it looks something like this:
- *
- * 21164 Address:
- *
- *          3         2         1
- * 9876543210987654321098765432109876543210
- * 1ZZZZ0.PCI.QW.Address............BBLL
- *
- * ZZ = SBZ
- * BB = Byte offset
- * LL = Transfer length
- *
- * PCI Address:
- *
- * 3         2         1
- * 10987654321098765432109876543210
- * HHH....PCI.QW.Address........ 00
- *
- * HHH = 31:29 HAE_MEM CSR
- *
- */
-
-#define t2_set_hae { \
-       msb = addr  >> 27; \
-       addr &= T2_MEM_R1_MASK; \
-       set_hae(msb); \
-}
-
-extern spinlock_t t2_hae_lock;
-
-/*
- * NOTE: take T2_DENSE_MEM off in each readX/writeX routine, since
- *       they may be called directly, rather than through the
- *       ioreadNN/iowriteNN routines.
- */
-
-__EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
-       unsigned long result, msb;
-       unsigned long flags;
-       spin_lock_irqsave(&t2_hae_lock, flags);
-
-       t2_set_hae;
-
-       result = *(vip) ((addr << 5) + T2_SPARSE_MEM + 0x00);
-       spin_unlock_irqrestore(&t2_hae_lock, flags);
-       return __kernel_extbl(result, addr & 3);
-}
-
-__EXTERN_INLINE u16 t2_readw(const volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
-       unsigned long result, msb;
-       unsigned long flags;
-       spin_lock_irqsave(&t2_hae_lock, flags);
-
-       t2_set_hae;
-
-       result = *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x08);
-       spin_unlock_irqrestore(&t2_hae_lock, flags);
-       return __kernel_extwl(result, addr & 3);
-}
-
-/*
- * On SABLE with T2, we must use SPARSE memory even for 32-bit access,
- * because we cannot access all of DENSE without changing its HAE.
- */
-__EXTERN_INLINE u32 t2_readl(const volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
-       unsigned long result, msb;
-       unsigned long flags;
-       spin_lock_irqsave(&t2_hae_lock, flags);
-
-       t2_set_hae;
-
-       result = *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18);
-       spin_unlock_irqrestore(&t2_hae_lock, flags);
-       return result & 0xffffffffUL;
-}
-
-__EXTERN_INLINE u64 t2_readq(const volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
-       unsigned long r0, r1, work, msb;
-       unsigned long flags;
-       spin_lock_irqsave(&t2_hae_lock, flags);
-
-       t2_set_hae;
-
-       work = (addr << 5) + T2_SPARSE_MEM + 0x18;
-       r0 = *(vuip)(work);
-       r1 = *(vuip)(work + (4 << 5));
-       spin_unlock_irqrestore(&t2_hae_lock, flags);
-       return r1 << 32 | r0;
-}
-
-__EXTERN_INLINE void t2_writeb(u8 b, volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
-       unsigned long msb, w;
-       unsigned long flags;
-       spin_lock_irqsave(&t2_hae_lock, flags);
-
-       t2_set_hae;
-
-       w = __kernel_insbl(b, addr & 3);
-       *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x00) = w;
-       spin_unlock_irqrestore(&t2_hae_lock, flags);
-}
-
-__EXTERN_INLINE void t2_writew(u16 b, volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
-       unsigned long msb, w;
-       unsigned long flags;
-       spin_lock_irqsave(&t2_hae_lock, flags);
-
-       t2_set_hae;
-
-       w = __kernel_inswl(b, addr & 3);
-       *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x08) = w;
-       spin_unlock_irqrestore(&t2_hae_lock, flags);
-}
-
-/*
- * On SABLE with T2, we must use SPARSE memory even for 32-bit access,
- * because we cannot access all of DENSE without changing its HAE.
- */
-__EXTERN_INLINE void t2_writel(u32 b, volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
-       unsigned long msb;
-       unsigned long flags;
-       spin_lock_irqsave(&t2_hae_lock, flags);
-
-       t2_set_hae;
-
-       *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18) = b;
-       spin_unlock_irqrestore(&t2_hae_lock, flags);
-}
-
-__EXTERN_INLINE void t2_writeq(u64 b, volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr - T2_DENSE_MEM;
-       unsigned long msb, work;
-       unsigned long flags;
-       spin_lock_irqsave(&t2_hae_lock, flags);
-
-       t2_set_hae;
-
-       work = (addr << 5) + T2_SPARSE_MEM + 0x18;
-       *(vuip)work = b;
-       *(vuip)(work + (4 << 5)) = b >> 32;
-       spin_unlock_irqrestore(&t2_hae_lock, flags);
-}
-
-__EXTERN_INLINE void __iomem *t2_ioportmap(unsigned long addr)
-{
-       return (void __iomem *)(addr + T2_IO);
-}
-
-__EXTERN_INLINE void __iomem *t2_ioremap(unsigned long addr, 
-                                        unsigned long size)
-{
-       return (void __iomem *)(addr + T2_DENSE_MEM);
-}
-
-__EXTERN_INLINE int t2_is_ioaddr(unsigned long addr)
-{
-       return (long)addr >= 0;
-}
-
-__EXTERN_INLINE int t2_is_mmio(const volatile void __iomem *addr)
-{
-       return (unsigned long)addr >= T2_DENSE_MEM;
-}
-
-/* New-style ioread interface.  The mmio routines are so ugly for T2 that
-   it doesn't make sense to merge the pio and mmio routines.  */
-
-#define IOPORT(OS, NS)                                                 \
-__EXTERN_INLINE unsigned int t2_ioread##NS(void __iomem *xaddr)                \
-{                                                                      \
-       if (t2_is_mmio(xaddr))                                          \
-               return t2_read##OS(xaddr);                              \
-       else                                                            \
-               return t2_in##OS((unsigned long)xaddr - T2_IO);         \
-}                                                                      \
-__EXTERN_INLINE void t2_iowrite##NS(u##NS b, void __iomem *xaddr)      \
-{                                                                      \
-       if (t2_is_mmio(xaddr))                                          \
-               t2_write##OS(b, xaddr);                                 \
-       else                                                            \
-               t2_out##OS(b, (unsigned long)xaddr - T2_IO);            \
-}
-
-IOPORT(b, 8)
-IOPORT(w, 16)
-IOPORT(l, 32)
-
-#undef IOPORT
-
-#undef vip
-#undef vuip
-
-#undef __IO_PREFIX
-#define __IO_PREFIX            t2
-#define t2_trivial_rw_bw       0
-#define t2_trivial_rw_lq       0
-#define t2_trivial_io_bw       0
-#define t2_trivial_io_lq       0
-#define t2_trivial_iounmap     1
-#include <asm/io_trivial.h>
-
-#ifdef __IO_EXTERN_INLINE
-#undef __EXTERN_INLINE
-#undef __IO_EXTERN_INLINE
-#endif
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_T2__H__ */
diff --git a/include/asm-alpha/core_titan.h b/include/asm-alpha/core_titan.h
deleted file mode 100644 (file)
index a17f6f3..0000000
+++ /dev/null
@@ -1,410 +0,0 @@
-#ifndef __ALPHA_TITAN__H__
-#define __ALPHA_TITAN__H__
-
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <asm/compiler.h>
-
-/*
- * TITAN is the internal names for a core logic chipset which provides
- * memory controller and PCI/AGP access for 21264 based systems.
- *
- * This file is based on:
- *
- * Titan Chipset Engineering Specification
- * Revision 0.12
- * 13 July 1999
- *
- */
-
-/* XXX: Do we need to conditionalize on this?  */
-#ifdef USE_48_BIT_KSEG
-#define TI_BIAS 0x80000000000UL
-#else
-#define TI_BIAS 0x10000000000UL
-#endif
-
-/*
- * CChip, DChip, and PChip registers
- */
-
-typedef struct {
-       volatile unsigned long csr __attribute__((aligned(64)));
-} titan_64;
-
-typedef struct {
-       titan_64        csc;
-       titan_64        mtr;
-       titan_64        misc;
-       titan_64        mpd;
-       titan_64        aar0;
-       titan_64        aar1;
-       titan_64        aar2;
-       titan_64        aar3;
-       titan_64        dim0;
-       titan_64        dim1;
-       titan_64        dir0;
-       titan_64        dir1;
-       titan_64        drir;
-       titan_64        prben;
-       titan_64        iic0;
-       titan_64        iic1;
-       titan_64        mpr0;
-       titan_64        mpr1;
-       titan_64        mpr2;
-       titan_64        mpr3;
-       titan_64        rsvd[2];
-       titan_64        ttr;
-       titan_64        tdr;
-       titan_64        dim2;
-       titan_64        dim3;
-       titan_64        dir2;
-       titan_64        dir3;
-       titan_64        iic2;
-       titan_64        iic3;
-       titan_64        pwr;
-       titan_64        reserved[17];
-       titan_64        cmonctla;
-       titan_64        cmonctlb;
-       titan_64        cmoncnt01;
-       titan_64        cmoncnt23;
-       titan_64        cpen;
-} titan_cchip;
-
-typedef struct {
-       titan_64        dsc;
-       titan_64        str;
-       titan_64        drev;
-       titan_64        dsc2;
-} titan_dchip;
-
-typedef struct {
-       titan_64        wsba[4];
-       titan_64        wsm[4];
-       titan_64        tba[4];
-       titan_64        pctl;
-       titan_64        plat;
-       titan_64        reserved0[2];
-       union {
-               struct {
-                       titan_64        serror;
-                       titan_64        serren;
-                       titan_64        serrset;
-                       titan_64        reserved0;
-                       titan_64        gperror;
-                       titan_64        gperren;
-                       titan_64        gperrset;
-                       titan_64        reserved1;
-                       titan_64        gtlbiv;
-                       titan_64        gtlbia;
-                       titan_64        reserved2[2];
-                       titan_64        sctl;
-                       titan_64        reserved3[3];
-               } g;
-               struct {
-                       titan_64        agperror;
-                       titan_64        agperren;
-                       titan_64        agperrset;
-                       titan_64        agplastwr;
-                       titan_64        aperror;
-                       titan_64        aperren;
-                       titan_64        aperrset;
-                       titan_64        reserved0;
-                       titan_64        atlbiv;
-                       titan_64        atlbia;
-                       titan_64        reserved1[6];
-               } a;
-       } port_specific;
-       titan_64        sprst;
-       titan_64        reserved1[31];
-} titan_pachip_port;
-
-typedef struct {
-       titan_pachip_port       g_port;
-       titan_pachip_port       a_port;
-} titan_pachip;
-
-#define TITAN_cchip    ((titan_cchip  *)(IDENT_ADDR+TI_BIAS+0x1A0000000UL))
-#define TITAN_dchip            ((titan_dchip  *)(IDENT_ADDR+TI_BIAS+0x1B0000800UL))
-#define TITAN_pachip0  ((titan_pachip *)(IDENT_ADDR+TI_BIAS+0x180000000UL))
-#define TITAN_pachip1  ((titan_pachip *)(IDENT_ADDR+TI_BIAS+0x380000000UL))
-extern unsigned TITAN_agp;
-extern int TITAN_bootcpu;
-
-/*
- * TITAN PA-chip Window Space Base Address register.
- * (WSBA[0-2])
- */
-#define wsba_m_ena 0x1                
-#define wsba_m_sg 0x2
-#define wsba_m_addr 0xFFF00000  
-#define wmask_k_sz1gb 0x3FF00000                   
-union TPAchipWSBA {
-       struct  {
-               unsigned wsba_v_ena : 1;
-               unsigned wsba_v_sg : 1;
-               unsigned wsba_v_rsvd1 : 18;
-               unsigned wsba_v_addr : 12;
-               unsigned wsba_v_rsvd2 : 32;
-        } wsba_r_bits;
-       int wsba_q_whole [2];
-};
-
-/*
- * TITAN PA-chip Control Register
- * This definition covers both the G-Port GPCTL and the A-PORT APCTL.
- * Bits <51:0> are the same in both cases. APCTL<63:52> are only 
- * applicable to AGP.
- */
-#define pctl_m_fbtb                    0x00000001
-#define pctl_m_thdis                   0x00000002
-#define pctl_m_chaindis                0x00000004
-#define pctl_m_tgtlat                  0x00000018
-#define pctl_m_hole                    0x00000020
-#define pctl_m_mwin                    0x00000040
-#define pctl_m_arbena                  0x00000080
-#define pctl_m_prigrp                  0x0000FF00
-#define pctl_m_ppri                    0x00010000
-#define pctl_m_pcispd66                0x00020000
-#define pctl_m_cngstlt                 0x003C0000
-#define pctl_m_ptpdesten               0x3FC00000
-#define pctl_m_dpcen                   0x40000000
-#define pctl_m_apcen           0x0000000080000000UL
-#define pctl_m_dcrtv           0x0000000300000000UL
-#define pctl_m_en_stepping     0x0000000400000000UL
-#define apctl_m_rsvd1          0x000FFFF800000000UL
-#define apctl_m_agp_rate       0x0030000000000000UL
-#define apctl_m_agp_sba_en     0x0040000000000000UL
-#define apctl_m_agp_en         0x0080000000000000UL
-#define apctl_m_rsvd2          0x0100000000000000UL
-#define apctl_m_agp_present    0x0200000000000000UL
-#define apctl_agp_hp_rd                0x1C00000000000000UL
-#define apctl_agp_lp_rd                0xE000000000000000UL
-#define gpctl_m_rsvd           0xFFFFFFF800000000UL
-union TPAchipPCTL {
-       struct {
-               unsigned pctl_v_fbtb : 1;               /* A/G [0]     */
-               unsigned pctl_v_thdis : 1;              /* A/G [1]     */
-               unsigned pctl_v_chaindis : 1;           /* A/G [2]     */
-               unsigned pctl_v_tgtlat : 2;             /* A/G [4:3]   */
-               unsigned pctl_v_hole : 1;               /* A/G [5]     */
-               unsigned pctl_v_mwin : 1;               /* A/G [6]     */
-               unsigned pctl_v_arbena : 1;             /* A/G [7]     */
-               unsigned pctl_v_prigrp : 8;             /* A/G [15:8]  */
-               unsigned pctl_v_ppri : 1;               /* A/G [16]    */
-               unsigned pctl_v_pcispd66 : 1;           /* A/G [17]    */
-               unsigned pctl_v_cngstlt : 4;            /* A/G [21:18] */
-               unsigned pctl_v_ptpdesten : 8;          /* A/G [29:22] */
-               unsigned pctl_v_dpcen : 1;              /* A/G [30]    */
-               unsigned pctl_v_apcen : 1;              /* A/G [31]    */
-               unsigned pctl_v_dcrtv : 2;              /* A/G [33:32] */
-               unsigned pctl_v_en_stepping :1;         /* A/G [34]    */
-               unsigned apctl_v_rsvd1 : 17;            /* A   [51:35] */
-               unsigned apctl_v_agp_rate : 2;          /* A   [53:52] */
-               unsigned apctl_v_agp_sba_en : 1;        /* A   [54]    */
-               unsigned apctl_v_agp_en : 1;            /* A   [55]    */
-               unsigned apctl_v_rsvd2 : 1;             /* A   [56]    */
-               unsigned apctl_v_agp_present : 1;       /* A   [57]    */
-               unsigned apctl_v_agp_hp_rd : 3;         /* A   [60:58] */
-               unsigned apctl_v_agp_lp_rd : 3;         /* A   [63:61] */
-       } pctl_r_bits;
-       unsigned int pctl_l_whole [2];
-       unsigned long pctl_q_whole;
-};
-
-/*
- * SERROR / SERREN / SERRSET
- */
-union TPAchipSERR {
-       struct {
-               unsigned serr_v_lost_uecc : 1;          /* [0]          */
-               unsigned serr_v_uecc : 1;               /* [1]          */
-               unsigned serr_v_cre : 1;                /* [2]          */
-               unsigned serr_v_nxio : 1;               /* [3]          */
-               unsigned serr_v_lost_cre : 1;           /* [4]          */
-               unsigned serr_v_rsvd0 : 10;             /* [14:5]       */
-               unsigned serr_v_addr : 32;              /* [46:15]      */
-               unsigned serr_v_rsvd1 : 5;              /* [51:47]      */
-               unsigned serr_v_source : 2;             /* [53:52]      */
-               unsigned serr_v_cmd : 2;                /* [55:54]      */
-               unsigned serr_v_syn : 8;                /* [63:56]      */
-       } serr_r_bits;
-       unsigned int serr_l_whole[2];
-       unsigned long serr_q_whole;
-};
-
-/*
- * GPERROR / APERROR / GPERREN / APERREN / GPERRSET / APERRSET
- */
-union TPAchipPERR {
-       struct {
-               unsigned long perr_v_lost : 1;          /* [0]          */
-               unsigned long perr_v_serr : 1;          /* [1]          */
-               unsigned long perr_v_perr : 1;          /* [2]          */
-               unsigned long perr_v_dcrto : 1;         /* [3]          */
-               unsigned long perr_v_sge : 1;           /* [4]          */
-               unsigned long perr_v_ape : 1;           /* [5]          */
-               unsigned long perr_v_ta : 1;            /* [6]          */
-               unsigned long perr_v_dpe : 1;           /* [7]          */
-               unsigned long perr_v_nds : 1;           /* [8]          */
-               unsigned long perr_v_iptpr : 1;         /* [9]          */
-               unsigned long perr_v_iptpw : 1;         /* [10]         */
-               unsigned long perr_v_rsvd0 : 3;         /* [13:11]      */
-               unsigned long perr_v_addr : 33;         /* [46:14]      */
-               unsigned long perr_v_dac : 1;           /* [47]         */
-               unsigned long perr_v_mwin : 1;          /* [48]         */
-               unsigned long perr_v_rsvd1 : 3;         /* [51:49]      */
-               unsigned long perr_v_cmd : 4;           /* [55:52]      */
-               unsigned long perr_v_rsvd2 : 8;         /* [63:56]      */
-       } perr_r_bits;
-       unsigned int perr_l_whole[2];
-       unsigned long perr_q_whole;
-};
-
-/*
- * AGPERROR / AGPERREN / AGPERRSET
- */
-union TPAchipAGPERR {
-       struct {
-               unsigned agperr_v_lost : 1;             /* [0]          */
-               unsigned agperr_v_lpqfull : 1;          /* [1]          */
-               unsigned apgerr_v_hpqfull : 1;          /* [2]          */
-               unsigned agperr_v_rescmd : 1;           /* [3]          */
-               unsigned agperr_v_ipte : 1;             /* [4]          */
-               unsigned agperr_v_ptp : 1;              /* [5]          */
-               unsigned agperr_v_nowindow : 1;         /* [6]          */
-               unsigned agperr_v_rsvd0 : 8;            /* [14:7]       */
-               unsigned agperr_v_addr : 32;            /* [46:15]      */
-               unsigned agperr_v_rsvd1 : 1;            /* [47]         */
-               unsigned agperr_v_dac : 1;              /* [48]         */
-               unsigned agperr_v_mwin : 1;             /* [49]         */
-               unsigned agperr_v_cmd : 3;              /* [52:50]      */
-               unsigned agperr_v_length : 6;           /* [58:53]      */
-               unsigned agperr_v_fence : 1;            /* [59]         */
-               unsigned agperr_v_rsvd2 : 4;            /* [63:60]      */
-       } agperr_r_bits;
-       unsigned int agperr_l_whole[2];
-       unsigned long agperr_q_whole;
-};
-/*
- * Memory spaces:
- * Hose numbers are assigned as follows:
- *             0 - pachip 0 / G Port
- *             1 - pachip 1 / G Port
- *             2 - pachip 0 / A Port
- *             3 - pachip 1 / A Port
- */
-#define TITAN_HOSE_SHIFT       (33) 
-#define TITAN_HOSE(h)          (((unsigned long)(h)) << TITAN_HOSE_SHIFT)
-#define TITAN_BASE             (IDENT_ADDR + TI_BIAS)
-#define TITAN_MEM(h)           (TITAN_BASE+TITAN_HOSE(h)+0x000000000UL)
-#define _TITAN_IACK_SC(h)      (TITAN_BASE+TITAN_HOSE(h)+0x1F8000000UL)
-#define TITAN_IO(h)            (TITAN_BASE+TITAN_HOSE(h)+0x1FC000000UL)
-#define TITAN_CONF(h)          (TITAN_BASE+TITAN_HOSE(h)+0x1FE000000UL)
-
-#define TITAN_HOSE_MASK                TITAN_HOSE(3)
-#define TITAN_IACK_SC          _TITAN_IACK_SC(0) /* hack! */
-
-/* 
- * The canonical non-remaped I/O and MEM addresses have these values
- * subtracted out.  This is arranged so that folks manipulating ISA
- * devices can use their familiar numbers and have them map to bus 0.
- */
-
-#define TITAN_IO_BIAS          TITAN_IO(0)
-#define TITAN_MEM_BIAS         TITAN_MEM(0)
-
-/* The IO address space is larger than 0xffff */
-#define TITAN_IO_SPACE         (TITAN_CONF(0) - TITAN_IO(0))
-
-/* TIG Space */
-#define TITAN_TIG_SPACE                (TITAN_BASE + 0x100000000UL)
-
-/* Offset between ram physical addresses and pci64 DAC bus addresses.  */
-/* ??? Just a guess.  Ought to confirm it hasn't been moved.  */
-#define TITAN_DAC_OFFSET       (1UL << 40)
-
-/*
- * Data structure for handling TITAN machine checks:
- */
-#define SCB_Q_SYSERR   0x620
-#define SCB_Q_PROCERR  0x630
-#define SCB_Q_SYSMCHK  0x660
-#define SCB_Q_PROCMCHK 0x670
-#define SCB_Q_SYSEVENT 0x680   /* environmental / system management */
-struct el_TITAN_sysdata_mcheck {
-       u64 summary;    /* 0x00 */
-       u64 c_dirx;     /* 0x08 */
-       u64 c_misc;     /* 0x10 */
-       u64 p0_serror;  /* 0x18 */
-       u64 p0_gperror; /* 0x20 */
-       u64 p0_aperror; /* 0x28 */
-       u64 p0_agperror;/* 0x30 */
-       u64 p1_serror;  /* 0x38 */
-       u64 p1_gperror; /* 0x40 */
-       u64 p1_aperror; /* 0x48 */
-       u64 p1_agperror;/* 0x50 */
-};
-
-/*
- * System area for a privateer 680 environmental/system management mcheck 
- */
-struct el_PRIVATEER_envdata_mcheck {
-       u64 summary;    /* 0x00 */
-       u64 c_dirx;     /* 0x08 */
-       u64 smir;       /* 0x10 */
-       u64 cpuir;      /* 0x18 */
-       u64 psir;       /* 0x20 */
-       u64 fault;      /* 0x28 */
-       u64 sys_doors;  /* 0x30 */
-       u64 temp_warn;  /* 0x38 */
-       u64 fan_ctrl;   /* 0x40 */
-       u64 code;       /* 0x48 */
-       u64 reserved;   /* 0x50 */
-};
-
-#ifdef __KERNEL__
-
-#ifndef __EXTERN_INLINE
-#define __EXTERN_INLINE extern inline
-#define __IO_EXTERN_INLINE
-#endif
-
-/*
- * I/O functions:
- *
- * TITAN, a 21??? PCI/memory support chipset for the EV6 (21264)
- * can only use linear accesses to get at PCI/AGP memory and I/O spaces.
- */
-
-/*
- * Memory functions.  all accesses are done through linear space.
- */
-extern void __iomem *titan_ioportmap(unsigned long addr);
-extern void __iomem *titan_ioremap(unsigned long addr, unsigned long size);
-extern void titan_iounmap(volatile void __iomem *addr);
-
-__EXTERN_INLINE int titan_is_ioaddr(unsigned long addr)
-{
-       return addr >= TITAN_BASE;
-}
-
-extern int titan_is_mmio(const volatile void __iomem *addr);
-
-#undef __IO_PREFIX
-#define __IO_PREFIX            titan
-#define titan_trivial_rw_bw    1
-#define titan_trivial_rw_lq    1
-#define titan_trivial_io_bw    1
-#define titan_trivial_io_lq    1
-#define titan_trivial_iounmap  0
-#include <asm/io_trivial.h>
-
-#ifdef __IO_EXTERN_INLINE
-#undef __EXTERN_INLINE
-#undef __IO_EXTERN_INLINE
-#endif
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_TITAN__H__ */
diff --git a/include/asm-alpha/core_tsunami.h b/include/asm-alpha/core_tsunami.h
deleted file mode 100644 (file)
index 58d4fe4..0000000
+++ /dev/null
@@ -1,335 +0,0 @@
-#ifndef __ALPHA_TSUNAMI__H__
-#define __ALPHA_TSUNAMI__H__
-
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <asm/compiler.h>
-
-/*
- * TSUNAMI/TYPHOON are the internal names for the core logic chipset which
- * provides memory controller and PCI access for the 21264 based systems.
- *
- * This file is based on:
- *
- * Tsunami System Programmers Manual
- * Preliminary, Chapters 2-5
- *
- */
-
-/* XXX: Do we need to conditionalize on this?  */
-#ifdef USE_48_BIT_KSEG
-#define TS_BIAS 0x80000000000UL
-#else
-#define TS_BIAS 0x10000000000UL
-#endif
-
-/*
- * CChip, DChip, and PChip registers
- */
-
-typedef struct {
-       volatile unsigned long csr __attribute__((aligned(64)));
-} tsunami_64;
-
-typedef struct {
-       tsunami_64      csc;
-       tsunami_64      mtr;
-       tsunami_64      misc;
-       tsunami_64      mpd;
-       tsunami_64      aar0;
-       tsunami_64      aar1;
-       tsunami_64      aar2;
-       tsunami_64      aar3;
-       tsunami_64      dim0;
-       tsunami_64      dim1;
-       tsunami_64      dir0;
-       tsunami_64      dir1;
-       tsunami_64      drir;
-       tsunami_64      prben;
-       tsunami_64      iic;    /* a.k.a. iic0 */
-       tsunami_64      wdr;    /* a.k.a. iic1 */
-       tsunami_64      mpr0;
-       tsunami_64      mpr1;
-       tsunami_64      mpr2;
-       tsunami_64      mpr3;
-       tsunami_64      mctl;
-       tsunami_64      __pad1;
-       tsunami_64      ttr;
-       tsunami_64      tdr;
-       tsunami_64      dim2;
-       tsunami_64      dim3;
-       tsunami_64      dir2;
-       tsunami_64      dir3;
-       tsunami_64      iic2;
-       tsunami_64      iic3;
-} tsunami_cchip;
-
-typedef struct {
-       tsunami_64      dsc;
-       tsunami_64      str;
-       tsunami_64      drev;
-} tsunami_dchip;
-
-typedef struct {
-       tsunami_64      wsba[4];
-       tsunami_64      wsm[4];
-       tsunami_64      tba[4];
-       tsunami_64      pctl;
-       tsunami_64      plat;
-       tsunami_64      reserved;
-       tsunami_64      perror;
-       tsunami_64      perrmask;
-       tsunami_64      perrset;
-       tsunami_64      tlbiv;
-       tsunami_64      tlbia;
-       tsunami_64      pmonctl;
-       tsunami_64      pmoncnt;
-} tsunami_pchip;
-
-#define TSUNAMI_cchip  ((tsunami_cchip *)(IDENT_ADDR+TS_BIAS+0x1A0000000UL))
-#define TSUNAMI_dchip  ((tsunami_dchip *)(IDENT_ADDR+TS_BIAS+0x1B0000800UL))
-#define TSUNAMI_pchip0 ((tsunami_pchip *)(IDENT_ADDR+TS_BIAS+0x180000000UL))
-#define TSUNAMI_pchip1 ((tsunami_pchip *)(IDENT_ADDR+TS_BIAS+0x380000000UL))
-extern int TSUNAMI_bootcpu;
-
-/*
- * TSUNAMI Pchip Error register.
- */
-
-#define perror_m_lost 0x1
-#define perror_m_serr 0x2
-#define perror_m_perr 0x4
-#define perror_m_dcrto 0x8
-#define perror_m_sge 0x10
-#define perror_m_ape 0x20
-#define perror_m_ta 0x40
-#define perror_m_rdpe 0x80
-#define perror_m_nds 0x100
-#define perror_m_rto 0x200
-#define perror_m_uecc 0x400
-#define perror_m_cre 0x800
-#define perror_m_addrl 0xFFFFFFFF0000UL
-#define perror_m_addrh 0x7000000000000UL
-#define perror_m_cmd 0xF0000000000000UL
-#define perror_m_syn 0xFF00000000000000UL
-union TPchipPERROR {   
-       struct  {
-               unsigned int perror_v_lost : 1;
-               unsigned perror_v_serr : 1;
-               unsigned perror_v_perr : 1;
-               unsigned perror_v_dcrto : 1;
-               unsigned perror_v_sge : 1;
-               unsigned perror_v_ape : 1;
-               unsigned perror_v_ta : 1;
-               unsigned perror_v_rdpe : 1;
-               unsigned perror_v_nds : 1;
-               unsigned perror_v_rto : 1;
-               unsigned perror_v_uecc : 1;
-               unsigned perror_v_cre : 1;                 
-               unsigned perror_v_rsvd1 : 4;
-               unsigned perror_v_addrl : 32;
-               unsigned perror_v_addrh : 3;
-               unsigned perror_v_rsvd2 : 1;
-               unsigned perror_v_cmd : 4;
-               unsigned perror_v_syn : 8;
-       } perror_r_bits;
-       int perror_q_whole [2];
-};                       
-
-/*
- * TSUNAMI Pchip Window Space Base Address register.
- */
-#define wsba_m_ena 0x1                
-#define wsba_m_sg 0x2
-#define wsba_m_ptp 0x4
-#define wsba_m_addr 0xFFF00000  
-#define wmask_k_sz1gb 0x3FF00000                   
-union TPchipWSBA {
-       struct  {
-               unsigned wsba_v_ena : 1;
-               unsigned wsba_v_sg : 1;
-               unsigned wsba_v_ptp : 1;
-               unsigned wsba_v_rsvd1 : 17;
-               unsigned wsba_v_addr : 12;
-               unsigned wsba_v_rsvd2 : 32;
-       } wsba_r_bits;
-       int wsba_q_whole [2];
-};
-
-/*
- * TSUNAMI Pchip Control Register
- */
-#define pctl_m_fdsc 0x1
-#define pctl_m_fbtb 0x2
-#define pctl_m_thdis 0x4
-#define pctl_m_chaindis 0x8
-#define pctl_m_tgtlat 0x10
-#define pctl_m_hole 0x20
-#define pctl_m_mwin 0x40
-#define pctl_m_arbena 0x80
-#define pctl_m_prigrp 0x7F00
-#define pctl_m_ppri 0x8000
-#define pctl_m_rsvd1 0x30000
-#define pctl_m_eccen 0x40000
-#define pctl_m_padm 0x80000
-#define pctl_m_cdqmax 0xF00000
-#define pctl_m_rev 0xFF000000
-#define pctl_m_crqmax 0xF00000000UL
-#define pctl_m_ptpmax 0xF000000000UL
-#define pctl_m_pclkx 0x30000000000UL
-#define pctl_m_fdsdis 0x40000000000UL
-#define pctl_m_fdwdis 0x80000000000UL
-#define pctl_m_ptevrfy 0x100000000000UL
-#define pctl_m_rpp 0x200000000000UL
-#define pctl_m_pid 0xC00000000000UL
-#define pctl_m_rsvd2 0xFFFF000000000000UL
-
-union TPchipPCTL {
-       struct {
-               unsigned pctl_v_fdsc : 1;
-               unsigned pctl_v_fbtb : 1;
-               unsigned pctl_v_thdis : 1;
-               unsigned pctl_v_chaindis : 1;
-               unsigned pctl_v_tgtlat : 1;
-               unsigned pctl_v_hole : 1;
-               unsigned pctl_v_mwin : 1;
-               unsigned pctl_v_arbena : 1;
-               unsigned pctl_v_prigrp : 7;
-               unsigned pctl_v_ppri : 1;
-               unsigned pctl_v_rsvd1 : 2;
-               unsigned pctl_v_eccen : 1;
-               unsigned pctl_v_padm : 1;
-               unsigned pctl_v_cdqmax : 4;
-               unsigned pctl_v_rev : 8;
-               unsigned pctl_v_crqmax : 4;
-               unsigned pctl_v_ptpmax : 4;
-               unsigned pctl_v_pclkx : 2;
-               unsigned pctl_v_fdsdis : 1;
-               unsigned pctl_v_fdwdis : 1;
-               unsigned pctl_v_ptevrfy : 1;
-               unsigned pctl_v_rpp : 1;
-               unsigned pctl_v_pid : 2;
-               unsigned pctl_v_rsvd2 : 16;
-       } pctl_r_bits;
-       int pctl_q_whole [2];
-};
-
-/*
- * TSUNAMI Pchip Error Mask Register.
- */
-#define perrmask_m_lost 0x1
-#define perrmask_m_serr 0x2
-#define perrmask_m_perr 0x4
-#define perrmask_m_dcrto 0x8
-#define perrmask_m_sge 0x10
-#define perrmask_m_ape 0x20
-#define perrmask_m_ta 0x40
-#define perrmask_m_rdpe 0x80
-#define perrmask_m_nds 0x100
-#define perrmask_m_rto 0x200
-#define perrmask_m_uecc 0x400
-#define perrmask_m_cre 0x800
-#define perrmask_m_rsvd 0xFFFFFFFFFFFFF000UL
-union TPchipPERRMASK {   
-       struct  {
-               unsigned int perrmask_v_lost : 1;
-               unsigned perrmask_v_serr : 1;
-               unsigned perrmask_v_perr : 1;
-               unsigned perrmask_v_dcrto : 1;
-               unsigned perrmask_v_sge : 1;
-               unsigned perrmask_v_ape : 1;
-               unsigned perrmask_v_ta : 1;
-               unsigned perrmask_v_rdpe : 1;
-               unsigned perrmask_v_nds : 1;
-               unsigned perrmask_v_rto : 1;
-               unsigned perrmask_v_uecc : 1;
-               unsigned perrmask_v_cre : 1;                 
-               unsigned perrmask_v_rsvd1 : 20;
-               unsigned perrmask_v_rsvd2 : 32;
-       } perrmask_r_bits;
-       int perrmask_q_whole [2];
-};                       
-
-/*
- * Memory spaces:
- */
-#define TSUNAMI_HOSE(h)                (((unsigned long)(h)) << 33)
-#define TSUNAMI_BASE           (IDENT_ADDR + TS_BIAS)
-
-#define TSUNAMI_MEM(h)         (TSUNAMI_BASE+TSUNAMI_HOSE(h) + 0x000000000UL)
-#define _TSUNAMI_IACK_SC(h)    (TSUNAMI_BASE+TSUNAMI_HOSE(h) + 0x1F8000000UL)
-#define TSUNAMI_IO(h)          (TSUNAMI_BASE+TSUNAMI_HOSE(h) + 0x1FC000000UL)
-#define TSUNAMI_CONF(h)                (TSUNAMI_BASE+TSUNAMI_HOSE(h) + 0x1FE000000UL)
-
-#define TSUNAMI_IACK_SC                _TSUNAMI_IACK_SC(0) /* hack! */
-
-
-/* 
- * The canonical non-remaped I/O and MEM addresses have these values
- * subtracted out.  This is arranged so that folks manipulating ISA
- * devices can use their familiar numbers and have them map to bus 0.
- */
-
-#define TSUNAMI_IO_BIAS          TSUNAMI_IO(0)
-#define TSUNAMI_MEM_BIAS         TSUNAMI_MEM(0)
-
-/* The IO address space is larger than 0xffff */
-#define TSUNAMI_IO_SPACE       (TSUNAMI_CONF(0) - TSUNAMI_IO(0))
-
-/* Offset between ram physical addresses and pci64 DAC bus addresses.  */
-#define TSUNAMI_DAC_OFFSET     (1UL << 40)
-
-/*
- * Data structure for handling TSUNAMI machine checks:
- */
-struct el_TSUNAMI_sysdata_mcheck {
-};
-
-
-#ifdef __KERNEL__
-
-#ifndef __EXTERN_INLINE
-#define __EXTERN_INLINE extern inline
-#define __IO_EXTERN_INLINE
-#endif
-
-/*
- * I/O functions:
- *
- * TSUNAMI, the 21??? PCI/memory support chipset for the EV6 (21264)
- * can only use linear accesses to get at PCI memory and I/O spaces.
- */
-
-/*
- * Memory functions.  all accesses are done through linear space.
- */
-extern void __iomem *tsunami_ioportmap(unsigned long addr);
-extern void __iomem *tsunami_ioremap(unsigned long addr, unsigned long size);
-__EXTERN_INLINE int tsunami_is_ioaddr(unsigned long addr)
-{
-       return addr >= TSUNAMI_BASE;
-}
-
-__EXTERN_INLINE int tsunami_is_mmio(const volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       return (addr & 0x100000000UL) == 0;
-}
-
-#undef __IO_PREFIX
-#define __IO_PREFIX            tsunami
-#define tsunami_trivial_rw_bw  1
-#define tsunami_trivial_rw_lq  1
-#define tsunami_trivial_io_bw  1
-#define tsunami_trivial_io_lq  1
-#define tsunami_trivial_iounmap        1
-#include <asm/io_trivial.h>
-
-#ifdef __IO_EXTERN_INLINE
-#undef __EXTERN_INLINE
-#undef __IO_EXTERN_INLINE
-#endif
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_TSUNAMI__H__ */
diff --git a/include/asm-alpha/core_wildfire.h b/include/asm-alpha/core_wildfire.h
deleted file mode 100644 (file)
index cd562f5..0000000
+++ /dev/null
@@ -1,318 +0,0 @@
-#ifndef __ALPHA_WILDFIRE__H__
-#define __ALPHA_WILDFIRE__H__
-
-#include <linux/types.h>
-#include <asm/compiler.h>
-
-#define WILDFIRE_MAX_QBB       8       /* more than 8 requires other mods */
-#define WILDFIRE_PCA_PER_QBB   4
-#define WILDFIRE_IRQ_PER_PCA   64
-
-#define WILDFIRE_NR_IRQS \
-  (WILDFIRE_MAX_QBB * WILDFIRE_PCA_PER_QBB * WILDFIRE_IRQ_PER_PCA)
-
-extern unsigned char wildfire_hard_qbb_map[WILDFIRE_MAX_QBB];
-extern unsigned char wildfire_soft_qbb_map[WILDFIRE_MAX_QBB];
-#define QBB_MAP_EMPTY  0xff
-
-extern unsigned long wildfire_hard_qbb_mask;
-extern unsigned long wildfire_soft_qbb_mask;
-extern unsigned long wildfire_gp_mask;
-extern unsigned long wildfire_hs_mask;
-extern unsigned long wildfire_iop_mask;
-extern unsigned long wildfire_ior_mask;
-extern unsigned long wildfire_pca_mask;
-extern unsigned long wildfire_cpu_mask;
-extern unsigned long wildfire_mem_mask;
-
-#define WILDFIRE_QBB_EXISTS(qbbno) (wildfire_soft_qbb_mask & (1 << (qbbno)))
-
-#define WILDFIRE_MEM_EXISTS(qbbno) (wildfire_mem_mask & (0xf << ((qbbno) << 2)))
-
-#define WILDFIRE_PCA_EXISTS(qbbno, pcano) \
-               (wildfire_pca_mask & (1 << (((qbbno) << 2) + (pcano))))
-
-typedef struct {
-       volatile unsigned long csr __attribute__((aligned(64)));
-} wildfire_64;
-
-typedef struct {
-       volatile unsigned long csr __attribute__((aligned(256)));
-} wildfire_256;
-
-typedef struct {
-       volatile unsigned long csr __attribute__((aligned(2048)));
-} wildfire_2k;
-
-typedef struct {
-       wildfire_64     qsd_whami;
-       wildfire_64     qsd_rev;
-       wildfire_64     qsd_port_present;
-       wildfire_64     qsd_port_active;
-       wildfire_64     qsd_fault_ena;
-       wildfire_64     qsd_cpu_int_ena;
-       wildfire_64     qsd_mem_config;
-       wildfire_64     qsd_err_sum;
-       wildfire_64     ce_sum[4];
-       wildfire_64     dev_init[4];
-       wildfire_64     it_int[4];
-       wildfire_64     ip_int[4];
-       wildfire_64     uce_sum[4];
-       wildfire_64     se_sum__non_dev_int[4];
-       wildfire_64     scratch[4];
-       wildfire_64     qsd_timer;
-       wildfire_64     qsd_diag;
-} wildfire_qsd;
-
-typedef struct {
-       wildfire_256    qsd_whami;
-       wildfire_256    __pad1;
-       wildfire_256    ce_sum;
-       wildfire_256    dev_init;
-       wildfire_256    it_int;
-       wildfire_256    ip_int;
-       wildfire_256    uce_sum;
-       wildfire_256    se_sum;
-} wildfire_fast_qsd;
-
-typedef struct {
-       wildfire_2k     qsa_qbb_id;
-       wildfire_2k     __pad1;
-       wildfire_2k     qsa_port_ena;
-       wildfire_2k     qsa_scratch;
-       wildfire_2k     qsa_config[5];
-       wildfire_2k     qsa_ref_int;
-       wildfire_2k     qsa_qbb_pop[2];
-       wildfire_2k     qsa_dtag_fc;
-       wildfire_2k     __pad2[3];
-       wildfire_2k     qsa_diag;
-       wildfire_2k     qsa_diag_lock[4];
-       wildfire_2k     __pad3[11];
-       wildfire_2k     qsa_cpu_err_sum;
-       wildfire_2k     qsa_misc_err_sum;
-       wildfire_2k     qsa_tmo_err_sum;
-       wildfire_2k     qsa_err_ena;
-       wildfire_2k     qsa_tmo_config;
-       wildfire_2k     qsa_ill_cmd_err_sum;
-       wildfire_2k     __pad4[26];
-       wildfire_2k     qsa_busy_mask;
-       wildfire_2k     qsa_arr_valid;
-       wildfire_2k     __pad5[2];
-       wildfire_2k     qsa_port_map[4];
-       wildfire_2k     qsa_arr_addr[8];
-       wildfire_2k     qsa_arr_mask[8];
-} wildfire_qsa;
-
-typedef struct {
-       wildfire_64     ioa_config;
-       wildfire_64     iod_config;
-       wildfire_64     iop_switch_credits;
-       wildfire_64     __pad1;
-       wildfire_64     iop_hose_credits;
-       wildfire_64     __pad2[11];
-       struct {
-               wildfire_64     __pad3;
-               wildfire_64     init;
-       } iop_hose[4];
-       wildfire_64     ioa_hose_0_ctrl;
-       wildfire_64     iod_hose_0_ctrl;
-       wildfire_64     ioa_hose_1_ctrl;
-       wildfire_64     iod_hose_1_ctrl;
-       wildfire_64     ioa_hose_2_ctrl;
-       wildfire_64     iod_hose_2_ctrl;
-       wildfire_64     ioa_hose_3_ctrl;
-       wildfire_64     iod_hose_3_ctrl;
-       struct {
-               wildfire_64     target;
-               wildfire_64     __pad4;
-       } iop_dev_int[4];
-
-       wildfire_64     iop_err_int_target;
-       wildfire_64     __pad5[7];
-       wildfire_64     iop_qbb_err_sum;
-       wildfire_64     __pad6;
-       wildfire_64     iop_qbb_se_sum;
-       wildfire_64     __pad7;
-       wildfire_64     ioa_err_sum;
-       wildfire_64     iod_err_sum;
-       wildfire_64     __pad8[4];
-       wildfire_64     ioa_diag_force_err;
-       wildfire_64     iod_diag_force_err;
-       wildfire_64     __pad9[4];
-       wildfire_64     iop_diag_send_err_int;
-       wildfire_64     __pad10[15];
-       wildfire_64     ioa_scratch;
-       wildfire_64     iod_scratch;
-} wildfire_iop;
-
-typedef struct {
-       wildfire_2k     gpa_qbb_map[4];
-       wildfire_2k     gpa_mem_pop_map;
-       wildfire_2k     gpa_scratch;
-       wildfire_2k     gpa_diag;
-       wildfire_2k     gpa_config_0;
-       wildfire_2k     __pad1;
-       wildfire_2k     gpa_init_id;
-       wildfire_2k     gpa_config_2;
-       /* not complete */
-} wildfire_gp;
-
-typedef struct {
-       wildfire_64     pca_what_am_i;
-       wildfire_64     pca_err_sum;
-       wildfire_64     pca_diag_force_err;
-       wildfire_64     pca_diag_send_err_int;
-       wildfire_64     pca_hose_credits;
-       wildfire_64     pca_scratch;
-       wildfire_64     pca_micro_addr;
-       wildfire_64     pca_micro_data;
-       wildfire_64     pca_pend_int;
-       wildfire_64     pca_sent_int;
-       wildfire_64     __pad1;
-       wildfire_64     pca_stdio_edge_level;
-       wildfire_64     __pad2[52];
-       struct {
-               wildfire_64     target;
-               wildfire_64     enable;
-       } pca_int[4];
-       wildfire_64     __pad3[56];
-       wildfire_64     pca_alt_sent_int[32];
-} wildfire_pca;
-
-typedef struct {
-       wildfire_64     ne_what_am_i;
-       /* not complete */
-} wildfire_ne;
-
-typedef struct {
-       wildfire_64     fe_what_am_i;
-       /* not complete */
-} wildfire_fe;
-
-typedef struct {
-       wildfire_64     pci_io_addr_ext;
-       wildfire_64     pci_ctrl;
-       wildfire_64     pci_err_sum;
-       wildfire_64     pci_err_addr;
-       wildfire_64     pci_stall_cnt;
-       wildfire_64     pci_iack_special;
-       wildfire_64     __pad1[2];
-       wildfire_64     pci_pend_int;
-       wildfire_64     pci_sent_int;
-       wildfire_64     __pad2[54];
-       struct {
-               wildfire_64     wbase;
-               wildfire_64     wmask;
-               wildfire_64     tbase;
-       } pci_window[4];
-       wildfire_64     pci_flush_tlb;
-       wildfire_64     pci_perf_mon;
-} wildfire_pci;
-
-#define WILDFIRE_ENTITY_SHIFT          18
-
-#define WILDFIRE_GP_ENTITY             (0x10UL << WILDFIRE_ENTITY_SHIFT)
-#define WILDFIRE_IOP_ENTITY            (0x08UL << WILDFIRE_ENTITY_SHIFT)
-#define WILDFIRE_QSA_ENTITY            (0x04UL << WILDFIRE_ENTITY_SHIFT)
-#define WILDFIRE_QSD_ENTITY_SLOW       (0x05UL << WILDFIRE_ENTITY_SHIFT)
-#define WILDFIRE_QSD_ENTITY_FAST       (0x01UL << WILDFIRE_ENTITY_SHIFT)
-
-#define WILDFIRE_PCA_ENTITY(pca)       ((0xc|(pca))<<WILDFIRE_ENTITY_SHIFT)
-
-#define WILDFIRE_BASE          (IDENT_ADDR | (1UL << 40))
-
-#define WILDFIRE_QBB_MASK      0x0fUL  /* for now, only 4 bits/16 QBBs */
-
-#define WILDFIRE_QBB(q)                ((~((long)(q)) & WILDFIRE_QBB_MASK) << 36)
-#define WILDFIRE_HOSE(h)       ((long)(h) << 33)
-
-#define WILDFIRE_QBB_IO(q)     (WILDFIRE_BASE | WILDFIRE_QBB(q))
-#define WILDFIRE_QBB_HOSE(q,h) (WILDFIRE_QBB_IO(q) | WILDFIRE_HOSE(h))
-
-#define WILDFIRE_MEM(q,h)      (WILDFIRE_QBB_HOSE(q,h) | 0x000000000UL)
-#define WILDFIRE_CONF(q,h)     (WILDFIRE_QBB_HOSE(q,h) | 0x1FE000000UL)
-#define WILDFIRE_IO(q,h)       (WILDFIRE_QBB_HOSE(q,h) | 0x1FF000000UL)
-
-#define WILDFIRE_qsd(q) \
- ((wildfire_qsd *)(WILDFIRE_QBB_IO(q)|WILDFIRE_QSD_ENTITY_SLOW|(((1UL<<13)-1)<<23)))
-
-#define WILDFIRE_fast_qsd() \
- ((wildfire_fast_qsd *)(WILDFIRE_QBB_IO(0)|WILDFIRE_QSD_ENTITY_FAST|(((1UL<<13)-1)<<23)))
-
-#define WILDFIRE_qsa(q) \
- ((wildfire_qsa *)(WILDFIRE_QBB_IO(q)|WILDFIRE_QSA_ENTITY|(((1UL<<13)-1)<<23)))
-
-#define WILDFIRE_iop(q) \
- ((wildfire_iop *)(WILDFIRE_QBB_IO(q)|WILDFIRE_IOP_ENTITY|(((1UL<<13)-1)<<23)))
-
-#define WILDFIRE_gp(q) \
- ((wildfire_gp *)(WILDFIRE_QBB_IO(q)|WILDFIRE_GP_ENTITY|(((1UL<<13)-1)<<23)))
-
-#define WILDFIRE_pca(q,pca) \
- ((wildfire_pca *)(WILDFIRE_QBB_IO(q)|WILDFIRE_PCA_ENTITY(pca)|(((1UL<<13)-1)<<23)))
-
-#define WILDFIRE_ne(q,pca) \
- ((wildfire_ne *)(WILDFIRE_QBB_IO(q)|WILDFIRE_PCA_ENTITY(pca)|(((1UL<<13)-1)<<23)|(1UL<<16)))
-
-#define WILDFIRE_fe(q,pca) \
- ((wildfire_fe *)(WILDFIRE_QBB_IO(q)|WILDFIRE_PCA_ENTITY(pca)|(((1UL<<13)-1)<<23)|(3UL<<15)))
-
-#define WILDFIRE_pci(q,h) \
- ((wildfire_pci *)(WILDFIRE_QBB_IO(q)|WILDFIRE_PCA_ENTITY(((h)&6)>>1)|((((h)&1)|2)<<16)|(((1UL<<13)-1)<<23)))
-
-#define WILDFIRE_IO_BIAS        WILDFIRE_IO(0,0)
-#define WILDFIRE_MEM_BIAS       WILDFIRE_MEM(0,0) /* ??? */
-
-/* The IO address space is larger than 0xffff */
-#define WILDFIRE_IO_SPACE      (8UL*1024*1024)
-
-#ifdef __KERNEL__
-
-#ifndef __EXTERN_INLINE
-#define __EXTERN_INLINE extern inline
-#define __IO_EXTERN_INLINE
-#endif
-
-/*
- * Memory functions.  all accesses are done through linear space.
- */
-
-__EXTERN_INLINE void __iomem *wildfire_ioportmap(unsigned long addr)
-{
-       return (void __iomem *)(addr + WILDFIRE_IO_BIAS);
-}
-
-__EXTERN_INLINE void __iomem *wildfire_ioremap(unsigned long addr, 
-                                              unsigned long size)
-{
-       return (void __iomem *)(addr + WILDFIRE_MEM_BIAS);
-}
-
-__EXTERN_INLINE int wildfire_is_ioaddr(unsigned long addr)
-{
-       return addr >= WILDFIRE_BASE;
-}
-
-__EXTERN_INLINE int wildfire_is_mmio(const volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long)xaddr;
-       return (addr & 0x100000000UL) == 0;
-}
-
-#undef __IO_PREFIX
-#define __IO_PREFIX                    wildfire
-#define wildfire_trivial_rw_bw         1
-#define wildfire_trivial_rw_lq         1
-#define wildfire_trivial_io_bw         1
-#define wildfire_trivial_io_lq         1
-#define wildfire_trivial_iounmap       1
-#include <asm/io_trivial.h>
-
-#ifdef __IO_EXTERN_INLINE
-#undef __EXTERN_INLINE
-#undef __IO_EXTERN_INLINE
-#endif
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_WILDFIRE__H__ */
diff --git a/include/asm-alpha/cputime.h b/include/asm-alpha/cputime.h
deleted file mode 100644 (file)
index 19577fd..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ALPHA_CPUTIME_H
-#define __ALPHA_CPUTIME_H
-
-#include <asm-generic/cputime.h>
-
-#endif /* __ALPHA_CPUTIME_H */
diff --git a/include/asm-alpha/current.h b/include/asm-alpha/current.h
deleted file mode 100644 (file)
index 094d285..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _ALPHA_CURRENT_H
-#define _ALPHA_CURRENT_H
-
-#include <linux/thread_info.h>
-
-#define get_current()  (current_thread_info()->task)
-#define current                get_current()
-
-#endif /* _ALPHA_CURRENT_H */
diff --git a/include/asm-alpha/delay.h b/include/asm-alpha/delay.h
deleted file mode 100644 (file)
index 2aa3f41..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __ALPHA_DELAY_H
-#define __ALPHA_DELAY_H
-
-extern void __delay(int loops);
-extern void udelay(unsigned long usecs);
-
-extern void ndelay(unsigned long nsecs);
-#define ndelay ndelay
-
-#endif /* defined(__ALPHA_DELAY_H) */
diff --git a/include/asm-alpha/device.h b/include/asm-alpha/device.h
deleted file mode 100644 (file)
index d8f9872..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * Arch specific extensions to struct device
- *
- * This file is released under the GPLv2
- */
-#include <asm-generic/device.h>
-
diff --git a/include/asm-alpha/div64.h b/include/asm-alpha/div64.h
deleted file mode 100644 (file)
index 6cd978c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/div64.h>
diff --git a/include/asm-alpha/dma-mapping.h b/include/asm-alpha/dma-mapping.h
deleted file mode 100644 (file)
index a5801ae..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifndef _ALPHA_DMA_MAPPING_H
-#define _ALPHA_DMA_MAPPING_H
-
-
-#ifdef CONFIG_PCI
-
-#include <linux/pci.h>
-
-#define dma_map_single(dev, va, size, dir)             \
-               pci_map_single(alpha_gendev_to_pci(dev), va, size, dir)
-#define dma_unmap_single(dev, addr, size, dir)         \
-               pci_unmap_single(alpha_gendev_to_pci(dev), addr, size, dir)
-#define dma_alloc_coherent(dev, size, addr, gfp)       \
-             __pci_alloc_consistent(alpha_gendev_to_pci(dev), size, addr, gfp)
-#define dma_free_coherent(dev, size, va, addr)         \
-               pci_free_consistent(alpha_gendev_to_pci(dev), size, va, addr)
-#define dma_map_page(dev, page, off, size, dir)                \
-               pci_map_page(alpha_gendev_to_pci(dev), page, off, size, dir)
-#define dma_unmap_page(dev, addr, size, dir)           \
-               pci_unmap_page(alpha_gendev_to_pci(dev), addr, size, dir)
-#define dma_map_sg(dev, sg, nents, dir)                        \
-               pci_map_sg(alpha_gendev_to_pci(dev), sg, nents, dir)
-#define dma_unmap_sg(dev, sg, nents, dir)              \
-               pci_unmap_sg(alpha_gendev_to_pci(dev), sg, nents, dir)
-#define dma_supported(dev, mask)                       \
-               pci_dma_supported(alpha_gendev_to_pci(dev), mask)
-#define dma_mapping_error(dev, addr)                           \
-               pci_dma_mapping_error(alpha_gendev_to_pci(dev), addr)
-
-#else  /* no PCI - no IOMMU. */
-
-struct scatterlist;
-void *dma_alloc_coherent(struct device *dev, size_t size,
-                        dma_addr_t *dma_handle, gfp_t gfp);
-int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
-              enum dma_data_direction direction);
-
-#define dma_free_coherent(dev, size, va, addr)         \
-               free_pages((unsigned long)va, get_order(size))
-#define dma_supported(dev, mask)               (mask < 0x00ffffffUL ? 0 : 1)
-#define dma_map_single(dev, va, size, dir)     virt_to_phys(va)
-#define dma_map_page(dev, page, off, size, dir)        (page_to_pa(page) + off)
-
-#define dma_unmap_single(dev, addr, size, dir) ((void)0)
-#define dma_unmap_page(dev, addr, size, dir)   ((void)0)
-#define dma_unmap_sg(dev, sg, nents, dir)      ((void)0)
-
-#define dma_mapping_error(dev, addr)  (0)
-
-#endif /* !CONFIG_PCI */
-
-#define dma_alloc_noncoherent(d, s, h, f)      dma_alloc_coherent(d, s, h, f)
-#define dma_free_noncoherent(d, s, v, h)       dma_free_coherent(d, s, v, h)
-#define dma_is_consistent(d, h)                        (1)
-
-int dma_set_mask(struct device *dev, u64 mask);
-
-#define dma_sync_single_for_cpu(dev, addr, size, dir)    ((void)0)
-#define dma_sync_single_for_device(dev, addr, size, dir)  ((void)0)
-#define dma_sync_single_range(dev, addr, off, size, dir)  ((void)0)
-#define dma_sync_sg_for_cpu(dev, sg, nents, dir)         ((void)0)
-#define dma_sync_sg_for_device(dev, sg, nents, dir)      ((void)0)
-#define dma_cache_sync(dev, va, size, dir)               ((void)0)
-#define dma_sync_single_range_for_cpu(dev, addr, offset, size, dir)    ((void)0)
-#define dma_sync_single_range_for_device(dev, addr, offset, size, dir) ((void)0)
-
-#define dma_get_cache_alignment()                        L1_CACHE_BYTES
-
-#endif /* _ALPHA_DMA_MAPPING_H */
diff --git a/include/asm-alpha/dma.h b/include/asm-alpha/dma.h
deleted file mode 100644 (file)
index 87cfdbd..0000000
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * include/asm-alpha/dma.h
- *
- * This is essentially the same as the i386 DMA stuff, as the AlphaPCs
- * use ISA-compatible dma.  The only extension is support for high-page
- * registers that allow to set the top 8 bits of a 32-bit DMA address.
- * This register should be written last when setting up a DMA address
- * as this will also enable DMA across 64 KB boundaries.
- */
-
-/* $Id: dma.h,v 1.7 1992/12/14 00:29:34 root Exp root $
- * linux/include/asm/dma.h: Defines for using and allocating dma channels.
- * Written by Hennus Bergman, 1992.
- * High DMA channel support & info by Hannu Savolainen
- * and John Boyd, Nov. 1992.
- */
-
-#ifndef _ASM_DMA_H
-#define _ASM_DMA_H
-
-#include <linux/spinlock.h>
-#include <asm/io.h>
-
-#define dma_outb       outb
-#define dma_inb                inb
-
-/*
- * NOTES about DMA transfers:
- *
- *  controller 1: channels 0-3, byte operations, ports 00-1F
- *  controller 2: channels 4-7, word operations, ports C0-DF
- *
- *  - ALL registers are 8 bits only, regardless of transfer size
- *  - channel 4 is not used - cascades 1 into 2.
- *  - channels 0-3 are byte - addresses/counts are for physical bytes
- *  - channels 5-7 are word - addresses/counts are for physical words
- *  - transfers must not cross physical 64K (0-3) or 128K (5-7) boundaries
- *  - transfer count loaded to registers is 1 less than actual count
- *  - controller 2 offsets are all even (2x offsets for controller 1)
- *  - page registers for 5-7 don't use data bit 0, represent 128K pages
- *  - page registers for 0-3 use bit 0, represent 64K pages
- *
- * DMA transfers are limited to the lower 16MB of _physical_ memory.  
- * Note that addresses loaded into registers must be _physical_ addresses,
- * not logical addresses (which may differ if paging is active).
- *
- *  Address mapping for channels 0-3:
- *
- *   A23 ... A16 A15 ... A8  A7 ... A0    (Physical addresses)
- *    |  ...  |   |  ... |   |  ... |
- *    |  ...  |   |  ... |   |  ... |
- *    |  ...  |   |  ... |   |  ... |
- *   P7  ...  P0  A7 ... A0  A7 ... A0   
- * |    Page    | Addr MSB | Addr LSB |   (DMA registers)
- *
- *  Address mapping for channels 5-7:
- *
- *   A23 ... A17 A16 A15 ... A9 A8 A7 ... A1 A0    (Physical addresses)
- *    |  ...  |   \   \   ... \  \  \  ... \  \
- *    |  ...  |    \   \   ... \  \  \  ... \  (not used)
- *    |  ...  |     \   \   ... \  \  \  ... \
- *   P7  ...  P1 (0) A7 A6  ... A0 A7 A6 ... A0   
- * |      Page      |  Addr MSB   |  Addr LSB  |   (DMA registers)
- *
- * Again, channels 5-7 transfer _physical_ words (16 bits), so addresses
- * and counts _must_ be word-aligned (the lowest address bit is _ignored_ at
- * the hardware level, so odd-byte transfers aren't possible).
- *
- * Transfer count (_not # bytes_) is limited to 64K, represented as actual
- * count - 1 : 64K => 0xFFFF, 1 => 0x0000.  Thus, count is always 1 or more,
- * and up to 128K bytes may be transferred on channels 5-7 in one operation. 
- *
- */
-
-#define MAX_DMA_CHANNELS       8
-
-/*
-  ISA DMA limitations on Alpha platforms,
-
-  These may be due to SIO (PCI<->ISA bridge) chipset limitation, or
-  just a wiring limit.
-*/
-
-/* The maximum address for ISA DMA transfer on Alpha XL, due to an
-   hardware SIO limitation, is 64MB.
-*/
-#define ALPHA_XL_MAX_ISA_DMA_ADDRESS           0x04000000UL
-
-/* The maximum address for ISA DMA transfer on RUFFIAN,
-   due to an hardware SIO limitation, is 16MB.
-*/
-#define ALPHA_RUFFIAN_MAX_ISA_DMA_ADDRESS      0x01000000UL
-
-/* The maximum address for ISA DMA transfer on SABLE, and some ALCORs,
-   due to an hardware SIO chip limitation, is 2GB.
-*/
-#define ALPHA_SABLE_MAX_ISA_DMA_ADDRESS                0x80000000UL
-#define ALPHA_ALCOR_MAX_ISA_DMA_ADDRESS                0x80000000UL
-
-/*
-  Maximum address for all the others is the complete 32-bit bus
-  address space.
-*/
-#define ALPHA_MAX_ISA_DMA_ADDRESS              0x100000000UL
-
-#ifdef CONFIG_ALPHA_GENERIC
-# define MAX_ISA_DMA_ADDRESS           (alpha_mv.max_isa_dma_address)
-#else
-# if defined(CONFIG_ALPHA_XL)
-#  define MAX_ISA_DMA_ADDRESS          ALPHA_XL_MAX_ISA_DMA_ADDRESS
-# elif defined(CONFIG_ALPHA_RUFFIAN)
-#  define MAX_ISA_DMA_ADDRESS          ALPHA_RUFFIAN_MAX_ISA_DMA_ADDRESS
-# elif defined(CONFIG_ALPHA_SABLE)
-#  define MAX_ISA_DMA_ADDRESS          ALPHA_SABLE_MAX_ISA_DMA_ADDRESS
-# elif defined(CONFIG_ALPHA_ALCOR)
-#  define MAX_ISA_DMA_ADDRESS          ALPHA_ALCOR_MAX_ISA_DMA_ADDRESS
-# else
-#  define MAX_ISA_DMA_ADDRESS          ALPHA_MAX_ISA_DMA_ADDRESS
-# endif
-#endif
-
-/* If we have the iommu, we don't have any address limitations on DMA.
-   Otherwise (Nautilus, RX164), we have to have 0-16 Mb DMA zone
-   like i386. */
-#define MAX_DMA_ADDRESS                (alpha_mv.mv_pci_tbi ?  \
-                                ~0UL : IDENT_ADDR + 0x01000000)
-
-/* 8237 DMA controllers */
-#define IO_DMA1_BASE   0x00    /* 8 bit slave DMA, channels 0..3 */
-#define IO_DMA2_BASE   0xC0    /* 16 bit master DMA, ch 4(=slave input)..7 */
-
-/* DMA controller registers */
-#define DMA1_CMD_REG           0x08    /* command register (w) */
-#define DMA1_STAT_REG          0x08    /* status register (r) */
-#define DMA1_REQ_REG            0x09    /* request register (w) */
-#define DMA1_MASK_REG          0x0A    /* single-channel mask (w) */
-#define DMA1_MODE_REG          0x0B    /* mode register (w) */
-#define DMA1_CLEAR_FF_REG      0x0C    /* clear pointer flip-flop (w) */
-#define DMA1_TEMP_REG           0x0D    /* Temporary Register (r) */
-#define DMA1_RESET_REG         0x0D    /* Master Clear (w) */
-#define DMA1_CLR_MASK_REG       0x0E    /* Clear Mask */
-#define DMA1_MASK_ALL_REG       0x0F    /* all-channels mask (w) */
-#define DMA1_EXT_MODE_REG      (0x400 | DMA1_MODE_REG)
-
-#define DMA2_CMD_REG           0xD0    /* command register (w) */
-#define DMA2_STAT_REG          0xD0    /* status register (r) */
-#define DMA2_REQ_REG            0xD2    /* request register (w) */
-#define DMA2_MASK_REG          0xD4    /* single-channel mask (w) */
-#define DMA2_MODE_REG          0xD6    /* mode register (w) */
-#define DMA2_CLEAR_FF_REG      0xD8    /* clear pointer flip-flop (w) */
-#define DMA2_TEMP_REG           0xDA    /* Temporary Register (r) */
-#define DMA2_RESET_REG         0xDA    /* Master Clear (w) */
-#define DMA2_CLR_MASK_REG       0xDC    /* Clear Mask */
-#define DMA2_MASK_ALL_REG       0xDE    /* all-channels mask (w) */
-#define DMA2_EXT_MODE_REG      (0x400 | DMA2_MODE_REG)
-
-#define DMA_ADDR_0              0x00    /* DMA address registers */
-#define DMA_ADDR_1              0x02
-#define DMA_ADDR_2              0x04
-#define DMA_ADDR_3              0x06
-#define DMA_ADDR_4              0xC0
-#define DMA_ADDR_5              0xC4
-#define DMA_ADDR_6              0xC8
-#define DMA_ADDR_7              0xCC
-
-#define DMA_CNT_0               0x01    /* DMA count registers */
-#define DMA_CNT_1               0x03
-#define DMA_CNT_2               0x05
-#define DMA_CNT_3               0x07
-#define DMA_CNT_4               0xC2
-#define DMA_CNT_5               0xC6
-#define DMA_CNT_6               0xCA
-#define DMA_CNT_7               0xCE
-
-#define DMA_PAGE_0              0x87    /* DMA page registers */
-#define DMA_PAGE_1              0x83
-#define DMA_PAGE_2              0x81
-#define DMA_PAGE_3              0x82
-#define DMA_PAGE_5              0x8B
-#define DMA_PAGE_6              0x89
-#define DMA_PAGE_7              0x8A
-
-#define DMA_HIPAGE_0           (0x400 | DMA_PAGE_0)
-#define DMA_HIPAGE_1           (0x400 | DMA_PAGE_1)
-#define DMA_HIPAGE_2           (0x400 | DMA_PAGE_2)
-#define DMA_HIPAGE_3           (0x400 | DMA_PAGE_3)
-#define DMA_HIPAGE_4           (0x400 | DMA_PAGE_4)
-#define DMA_HIPAGE_5           (0x400 | DMA_PAGE_5)
-#define DMA_HIPAGE_6           (0x400 | DMA_PAGE_6)
-#define DMA_HIPAGE_7           (0x400 | DMA_PAGE_7)
-
-#define DMA_MODE_READ  0x44    /* I/O to memory, no autoinit, increment, single mode */
-#define DMA_MODE_WRITE 0x48    /* memory to I/O, no autoinit, increment, single mode */
-#define DMA_MODE_CASCADE 0xC0   /* pass thru DREQ->HRQ, DACK<-HLDA only */
-
-#define DMA_AUTOINIT   0x10
-
-extern spinlock_t  dma_spin_lock;
-
-static __inline__ unsigned long claim_dma_lock(void)
-{
-       unsigned long flags;
-       spin_lock_irqsave(&dma_spin_lock, flags);
-       return flags;
-}
-
-static __inline__ void release_dma_lock(unsigned long flags)
-{
-       spin_unlock_irqrestore(&dma_spin_lock, flags);
-}
-
-/* enable/disable a specific DMA channel */
-static __inline__ void enable_dma(unsigned int dmanr)
-{
-       if (dmanr<=3)
-               dma_outb(dmanr,  DMA1_MASK_REG);
-       else
-               dma_outb(dmanr & 3,  DMA2_MASK_REG);
-}
-
-static __inline__ void disable_dma(unsigned int dmanr)
-{
-       if (dmanr<=3)
-               dma_outb(dmanr | 4,  DMA1_MASK_REG);
-       else
-               dma_outb((dmanr & 3) | 4,  DMA2_MASK_REG);
-}
-
-/* Clear the 'DMA Pointer Flip Flop'.
- * Write 0 for LSB/MSB, 1 for MSB/LSB access.
- * Use this once to initialize the FF to a known state.
- * After that, keep track of it. :-)
- * --- In order to do that, the DMA routines below should ---
- * --- only be used while interrupts are disabled! ---
- */
-static __inline__ void clear_dma_ff(unsigned int dmanr)
-{
-       if (dmanr<=3)
-               dma_outb(0,  DMA1_CLEAR_FF_REG);
-       else
-               dma_outb(0,  DMA2_CLEAR_FF_REG);
-}
-
-/* set mode (above) for a specific DMA channel */
-static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
-{
-       if (dmanr<=3)
-               dma_outb(mode | dmanr,  DMA1_MODE_REG);
-       else
-               dma_outb(mode | (dmanr&3),  DMA2_MODE_REG);
-}
-
-/* set extended mode for a specific DMA channel */
-static __inline__ void set_dma_ext_mode(unsigned int dmanr, char ext_mode)
-{
-       if (dmanr<=3)
-               dma_outb(ext_mode | dmanr,  DMA1_EXT_MODE_REG);
-       else
-               dma_outb(ext_mode | (dmanr&3),  DMA2_EXT_MODE_REG);
-}
-
-/* Set only the page register bits of the transfer address.
- * This is used for successive transfers when we know the contents of
- * the lower 16 bits of the DMA current address register.
- */
-static __inline__ void set_dma_page(unsigned int dmanr, unsigned int pagenr)
-{
-       switch(dmanr) {
-               case 0:
-                       dma_outb(pagenr, DMA_PAGE_0);
-                       dma_outb((pagenr >> 8), DMA_HIPAGE_0);
-                       break;
-               case 1:
-                       dma_outb(pagenr, DMA_PAGE_1);
-                       dma_outb((pagenr >> 8), DMA_HIPAGE_1);
-                       break;
-               case 2:
-                       dma_outb(pagenr, DMA_PAGE_2);
-                       dma_outb((pagenr >> 8), DMA_HIPAGE_2);
-                       break;
-               case 3:
-                       dma_outb(pagenr, DMA_PAGE_3);
-                       dma_outb((pagenr >> 8), DMA_HIPAGE_3);
-                       break;
-               case 5:
-                       dma_outb(pagenr & 0xfe, DMA_PAGE_5);
-                       dma_outb((pagenr >> 8), DMA_HIPAGE_5);
-                       break;
-               case 6:
-                       dma_outb(pagenr & 0xfe, DMA_PAGE_6);
-                       dma_outb((pagenr >> 8), DMA_HIPAGE_6);
-                       break;
-               case 7:
-                       dma_outb(pagenr & 0xfe, DMA_PAGE_7);
-                       dma_outb((pagenr >> 8), DMA_HIPAGE_7);
-                       break;
-       }
-}
-
-
-/* Set transfer address & page bits for specific DMA channel.
- * Assumes dma flipflop is clear.
- */
-static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
-{
-       if (dmanr <= 3)  {
-           dma_outb( a & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE );
-            dma_outb( (a>>8) & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE );
-       }  else  {
-           dma_outb( (a>>1) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE );
-           dma_outb( (a>>9) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE );
-       }
-       set_dma_page(dmanr, a>>16);     /* set hipage last to enable 32-bit mode */
-}
-
-
-/* Set transfer size (max 64k for DMA1..3, 128k for DMA5..7) for
- * a specific DMA channel.
- * You must ensure the parameters are valid.
- * NOTE: from a manual: "the number of transfers is one more
- * than the initial word count"! This is taken into account.
- * Assumes dma flip-flop is clear.
- * NOTE 2: "count" represents _bytes_ and must be even for channels 5-7.
- */
-static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
-{
-        count--;
-       if (dmanr <= 3)  {
-           dma_outb( count & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE );
-           dma_outb( (count>>8) & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE );
-        } else {
-           dma_outb( (count>>1) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE );
-           dma_outb( (count>>9) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE );
-        }
-}
-
-
-/* Get DMA residue count. After a DMA transfer, this
- * should return zero. Reading this while a DMA transfer is
- * still in progress will return unpredictable results.
- * If called before the channel has been used, it may return 1.
- * Otherwise, it returns the number of _bytes_ left to transfer.
- *
- * Assumes DMA flip-flop is clear.
- */
-static __inline__ int get_dma_residue(unsigned int dmanr)
-{
-       unsigned int io_port = (dmanr<=3)? ((dmanr&3)<<1) + 1 + IO_DMA1_BASE
-                                        : ((dmanr&3)<<2) + 2 + IO_DMA2_BASE;
-
-       /* using short to get 16-bit wrap around */
-       unsigned short count;
-
-       count = 1 + dma_inb(io_port);
-       count += dma_inb(io_port) << 8;
-       
-       return (dmanr<=3)? count : (count<<1);
-}
-
-
-/* These are in kernel/dma.c: */
-extern int request_dma(unsigned int dmanr, const char * device_id);    /* reserve a DMA channel */
-extern void free_dma(unsigned int dmanr);      /* release it again */
-#define KERNEL_HAVE_CHECK_DMA
-extern int check_dma(unsigned int dmanr);
-
-/* From PCI */
-
-#ifdef CONFIG_PCI
-extern int isa_dma_bridge_buggy;
-#else
-#define isa_dma_bridge_buggy   (0)
-#endif
-
-
-#endif /* _ASM_DMA_H */
diff --git a/include/asm-alpha/elf.h b/include/asm-alpha/elf.h
deleted file mode 100644 (file)
index fc1002e..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-#ifndef __ASM_ALPHA_ELF_H
-#define __ASM_ALPHA_ELF_H
-
-#include <asm/auxvec.h>
-
-/* Special values for the st_other field in the symbol table.  */
-
-#define STO_ALPHA_NOPV         0x80
-#define STO_ALPHA_STD_GPLOAD   0x88
-
-/*
- * Alpha ELF relocation types
- */
-#define R_ALPHA_NONE            0       /* No reloc */
-#define R_ALPHA_REFLONG         1       /* Direct 32 bit */
-#define R_ALPHA_REFQUAD         2       /* Direct 64 bit */
-#define R_ALPHA_GPREL32         3       /* GP relative 32 bit */
-#define R_ALPHA_LITERAL         4       /* GP relative 16 bit w/optimization */
-#define R_ALPHA_LITUSE          5       /* Optimization hint for LITERAL */
-#define R_ALPHA_GPDISP          6       /* Add displacement to GP */
-#define R_ALPHA_BRADDR          7       /* PC+4 relative 23 bit shifted */
-#define R_ALPHA_HINT            8       /* PC+4 relative 16 bit shifted */
-#define R_ALPHA_SREL16          9       /* PC relative 16 bit */
-#define R_ALPHA_SREL32          10      /* PC relative 32 bit */
-#define R_ALPHA_SREL64          11      /* PC relative 64 bit */
-#define R_ALPHA_GPRELHIGH       17      /* GP relative 32 bit, high 16 bits */
-#define R_ALPHA_GPRELLOW        18      /* GP relative 32 bit, low 16 bits */
-#define R_ALPHA_GPREL16         19      /* GP relative 16 bit */
-#define R_ALPHA_COPY            24      /* Copy symbol at runtime */
-#define R_ALPHA_GLOB_DAT        25      /* Create GOT entry */
-#define R_ALPHA_JMP_SLOT        26      /* Create PLT entry */
-#define R_ALPHA_RELATIVE        27      /* Adjust by program base */
-#define R_ALPHA_BRSGP          28
-#define R_ALPHA_TLSGD           29
-#define R_ALPHA_TLS_LDM         30
-#define R_ALPHA_DTPMOD64        31
-#define R_ALPHA_GOTDTPREL       32
-#define R_ALPHA_DTPREL64        33
-#define R_ALPHA_DTPRELHI        34
-#define R_ALPHA_DTPRELLO        35
-#define R_ALPHA_DTPREL16        36
-#define R_ALPHA_GOTTPREL        37
-#define R_ALPHA_TPREL64         38
-#define R_ALPHA_TPRELHI         39
-#define R_ALPHA_TPRELLO         40
-#define R_ALPHA_TPREL16         41
-
-#define SHF_ALPHA_GPREL                0x10000000
-
-/* Legal values for e_flags field of Elf64_Ehdr.  */
-
-#define EF_ALPHA_32BIT         1       /* All addresses are below 2GB */
-
-/*
- * ELF register definitions..
- */
-
-/*
- * The OSF/1 version of <sys/procfs.h> makes gregset_t 46 entries long.
- * I have no idea why that is so.  For now, we just leave it at 33
- * (32 general regs + processor status word). 
- */
-#define ELF_NGREG      33
-#define ELF_NFPREG     32
-
-typedef unsigned long elf_greg_t;
-typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-
-typedef double elf_fpreg_t;
-typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
-
-/*
- * This is used to ensure we don't load something for the wrong architecture.
- */
-#define elf_check_arch(x) ((x)->e_machine == EM_ALPHA)
-
-/*
- * These are used to set parameters in the core dumps.
- */
-#define ELF_CLASS      ELFCLASS64
-#define ELF_DATA       ELFDATA2LSB
-#define ELF_ARCH       EM_ALPHA
-
-#define USE_ELF_CORE_DUMP
-#define ELF_EXEC_PAGESIZE      8192
-
-/* This is the location that an ET_DYN program is loaded if exec'ed.  Typical
-   use of this is to invoke "./ld.so someprog" to test out a new version of
-   the loader.  We need to make sure that it is out of the way of the program
-   that it will "exec", and that there is sufficient room for the brk.  */
-
-#define ELF_ET_DYN_BASE                (TASK_UNMAPPED_BASE + 0x1000000)
-
-/* $0 is set by ld.so to a pointer to a function which might be 
-   registered using atexit.  This provides a mean for the dynamic
-   linker to call DT_FINI functions for shared libraries that have
-   been loaded before the code runs.
-
-   So that we can use the same startup file with static executables,
-   we start programs with a value of 0 to indicate that there is no
-   such function.  */
-
-#define ELF_PLAT_INIT(_r, load_addr)   _r->r0 = 0
-
-/* The registers are layed out in pt_regs for PAL and syscall
-   convenience.  Re-order them for the linear elf_gregset_t.  */
-
-struct pt_regs;
-struct thread_info;
-struct task_struct;
-extern void dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt,
-                           struct thread_info *ti);
-#define ELF_CORE_COPY_REGS(DEST, REGS) \
-       dump_elf_thread(DEST, REGS, current_thread_info());
-
-/* Similar, but for a thread other than current.  */
-
-extern int dump_elf_task(elf_greg_t *dest, struct task_struct *task);
-#define ELF_CORE_COPY_TASK_REGS(TASK, DEST) \
-       dump_elf_task(*(DEST), TASK)
-
-/* Similar, but for the FP registers.  */
-
-extern int dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task);
-#define ELF_CORE_COPY_FPREGS(TASK, DEST) \
-       dump_elf_task_fp(*(DEST), TASK)
-
-/* This yields a mask that user programs can use to figure out what
-   instruction set this CPU supports.  This is trivial on Alpha, 
-   but not so on other machines. */
-
-#define ELF_HWCAP  (~amask(-1))
-
-/* This yields a string that ld.so will use to load implementation
-   specific libraries for optimization.  This is more specific in
-   intent than poking at uname or /proc/cpuinfo.  */
-
-#define ELF_PLATFORM                           \
-({                                             \
-       enum implver_enum i_ = implver();       \
-       ( i_ == IMPLVER_EV4 ? "ev4"             \
-       : i_ == IMPLVER_EV5                     \
-         ? (amask(AMASK_BWX) ? "ev5" : "ev56") \
-       : amask (AMASK_CIX) ? "ev6" : "ev67");  \
-})
-
-#define SET_PERSONALITY(EX, IBCS2)                             \
-       set_personality(((EX).e_flags & EF_ALPHA_32BIT)         \
-          ? PER_LINUX_32BIT : (IBCS2) ? PER_SVR4 : PER_LINUX)
-
-extern int alpha_l1i_cacheshape;
-extern int alpha_l1d_cacheshape;
-extern int alpha_l2_cacheshape;
-extern int alpha_l3_cacheshape;
-
-/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
-#define ARCH_DLINFO                                            \
-  do {                                                         \
-    NEW_AUX_ENT(AT_L1I_CACHESHAPE, alpha_l1i_cacheshape);      \
-    NEW_AUX_ENT(AT_L1D_CACHESHAPE, alpha_l1d_cacheshape);      \
-    NEW_AUX_ENT(AT_L2_CACHESHAPE, alpha_l2_cacheshape);                \
-    NEW_AUX_ENT(AT_L3_CACHESHAPE, alpha_l3_cacheshape);                \
-  } while (0)
-
-#endif /* __ASM_ALPHA_ELF_H */
diff --git a/include/asm-alpha/emergency-restart.h b/include/asm-alpha/emergency-restart.h
deleted file mode 100644 (file)
index 108d8c4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_EMERGENCY_RESTART_H
-#define _ASM_EMERGENCY_RESTART_H
-
-#include <asm-generic/emergency-restart.h>
-
-#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-alpha/err_common.h b/include/asm-alpha/err_common.h
deleted file mode 100644 (file)
index c250959..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *     linux/include/asm-alpha/err_common.h
- *
- *     Copyright (C) 2000 Jeff Wiedemeier (Compaq Computer Corporation)
- *
- *     Contains declarations and macros to support Alpha error handling
- *     implementations.
- */
-
-#ifndef __ALPHA_ERR_COMMON_H
-#define __ALPHA_ERR_COMMON_H 1
-
-/*
- * SCB Vector definitions
- */
-#define SCB_Q_SYSERR   0x620
-#define SCB_Q_PROCERR  0x630
-#define SCB_Q_SYSMCHK  0x660
-#define SCB_Q_PROCMCHK 0x670
-#define SCB_Q_SYSEVENT 0x680
-
-/*
- * Disposition definitions for logout frame parser
- */
-#define MCHK_DISPOSITION_UNKNOWN_ERROR         0x00
-#define MCHK_DISPOSITION_REPORT                        0x01
-#define MCHK_DISPOSITION_DISMISS               0x02
-
-/*
- * Error Log definitions
- */
-/*
- * Types
- */
-
-#define EL_CLASS__TERMINATION          (0)
-#  define EL_TYPE__TERMINATION__TERMINATION            (0)
-#define EL_CLASS__HEADER               (5)
-#  define EL_TYPE__HEADER__SYSTEM_ERROR_FRAME          (1)
-#  define EL_TYPE__HEADER__SYSTEM_EVENT_FRAME          (2)
-#  define EL_TYPE__HEADER__HALT_FRAME                  (3)
-#  define EL_TYPE__HEADER__LOGOUT_FRAME                        (19)
-#define EL_CLASS__GENERAL_NOTIFICATION (9)
-#define EL_CLASS__PCI_ERROR_FRAME      (11)
-#define EL_CLASS__REGATTA_FAMILY       (12)
-#  define EL_TYPE__REGATTA__PROCESSOR_ERROR_FRAME      (1)
-#  define EL_TYPE__REGATTA__SYSTEM_ERROR_FRAME         (2)
-#  define EL_TYPE__REGATTA__ENVIRONMENTAL_FRAME                (3)
-#  define EL_TYPE__REGATTA__TITAN_PCHIP0_EXTENDED      (8)
-#  define EL_TYPE__REGATTA__TITAN_PCHIP1_EXTENDED      (9)
-#  define EL_TYPE__REGATTA__TITAN_MEMORY_EXTENDED      (10)
-#  define EL_TYPE__REGATTA__PROCESSOR_DBL_ERROR_HALT   (11)
-#  define EL_TYPE__REGATTA__SYSTEM_DBL_ERROR_HALT      (12)
-#define EL_CLASS__PAL                   (14)
-#  define EL_TYPE__PAL__LOGOUT_FRAME                    (1)
-#  define EL_TYPE__PAL__EV7_PROCESSOR                  (4)
-#  define EL_TYPE__PAL__EV7_ZBOX                       (5)
-#  define EL_TYPE__PAL__EV7_RBOX                       (6)
-#  define EL_TYPE__PAL__EV7_IO                         (7)
-#  define EL_TYPE__PAL__ENV__AMBIENT_TEMPERATURE       (10)
-#  define EL_TYPE__PAL__ENV__AIRMOVER_FAN              (11)
-#  define EL_TYPE__PAL__ENV__VOLTAGE                   (12)
-#  define EL_TYPE__PAL__ENV__INTRUSION                 (13)
-#  define EL_TYPE__PAL__ENV__POWER_SUPPLY              (14)
-#  define EL_TYPE__PAL__ENV__LAN                       (15)
-#  define EL_TYPE__PAL__ENV__HOT_PLUG                  (16)
-
-union el_timestamp {
-       struct {
-               u8 second;
-               u8 minute;
-               u8 hour;
-               u8 day;
-               u8 month;
-               u8 year;
-       } b;
-       u64 as_int;
-};
-
-struct el_subpacket {
-       u16 length;             /* length of header (in bytes)  */
-       u16 class;              /* header class and type...     */
-       u16 type;               /* ...determine content         */
-       u16 revision;           /* header revision              */
-       union {
-               struct {        /* Class 5, Type 1 - System Error       */
-                       u32 frame_length;
-                       u32 frame_packet_count;                 
-               } sys_err;                      
-               struct {        /* Class 5, Type 2 - System Event       */
-                       union el_timestamp timestamp;
-                       u32 frame_length;
-                       u32 frame_packet_count;                 
-               } sys_event;
-               struct {        /* Class 5, Type 3 - Double Error Halt  */
-                       u16 halt_code;
-                       u16 reserved;
-                       union el_timestamp timestamp;
-                       u32 frame_length;
-                       u32 frame_packet_count;
-               } err_halt;
-               struct {        /* Clasee 5, Type 19 - Logout Frame Header */
-                       u32 frame_length;
-                       u32 frame_flags;
-                       u32 cpu_offset; 
-                       u32 system_offset;
-               } logout_header;
-               struct {        /* Class 12 - Regatta                   */
-                       u64 cpuid;
-                       u64 data_start[1];
-               } regatta_frame;
-               struct {        /* Raw                                  */
-                       u64 data_start[1];
-               } raw;
-       } by_type;
-};
-
-#endif /* __ALPHA_ERR_COMMON_H */
diff --git a/include/asm-alpha/err_ev6.h b/include/asm-alpha/err_ev6.h
deleted file mode 100644 (file)
index ea63779..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ALPHA_ERR_EV6_H
-#define __ALPHA_ERR_EV6_H 1
-
-/* Dummy include for now. */
-
-#endif /* __ALPHA_ERR_EV6_H */
diff --git a/include/asm-alpha/err_ev7.h b/include/asm-alpha/err_ev7.h
deleted file mode 100644 (file)
index 87f9977..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-#ifndef __ALPHA_ERR_EV7_H
-#define __ALPHA_ERR_EV7_H 1
-
-/*
- * Data for el packet class PAL (14), type LOGOUT_FRAME (1)
- */
-struct ev7_pal_logout_subpacket {
-       u32 mchk_code;
-       u32 subpacket_count;
-       u64 whami;
-       u64 rbox_whami;
-       u64 rbox_int;
-       u64 exc_addr;
-       union el_timestamp timestamp;
-       u64 halt_code;
-       u64 reserved;
-};
-
-/*
- * Data for el packet class PAL (14), type EV7_PROCESSOR (4)
- */
-struct ev7_pal_processor_subpacket {
-       u64 i_stat;
-       u64 dc_stat;
-       u64 c_addr;
-       u64 c_syndrome_1;
-       u64 c_syndrome_0;
-       u64 c_stat;
-       u64 c_sts;
-       u64 mm_stat;
-       u64 exc_addr;
-       u64 ier_cm;
-       u64 isum;
-       u64 pal_base;
-       u64 i_ctl;
-       u64 process_context;
-       u64 cbox_ctl;
-       u64 cbox_stp_ctl;
-       u64 cbox_acc_ctl;
-       u64 cbox_lcl_set;
-       u64 cbox_gbl_set;
-       u64 bbox_ctl;
-       u64 bbox_err_sts;
-       u64 bbox_err_idx;
-       u64 cbox_ddp_err_sts;
-       u64 bbox_dat_rmp;
-       u64 reserved[2];
-};
-
-/*
- * Data for el packet class PAL (14), type EV7_ZBOX (5)
- */
-struct ev7_pal_zbox_subpacket {
-       u32 zbox0_dram_err_status_1;
-       u32 zbox0_dram_err_status_2;
-       u32 zbox0_dram_err_status_3;
-       u32 zbox0_dram_err_ctl;
-       u32 zbox0_dram_err_adr;
-       u32 zbox0_dift_timeout;
-       u32 zbox0_dram_mapper_ctl;
-       u32 zbox0_frc_err_adr;
-       u32 zbox0_dift_err_status;
-       u32 reserved1;
-       u32 zbox1_dram_err_status_1;
-       u32 zbox1_dram_err_status_2;
-       u32 zbox1_dram_err_status_3;
-       u32 zbox1_dram_err_ctl;
-       u32 zbox1_dram_err_adr;
-       u32 zbox1_dift_timeout;
-       u32 zbox1_dram_mapper_ctl;
-       u32 zbox1_frc_err_adr;
-       u32 zbox1_dift_err_status;
-       u32 reserved2;
-       u64 cbox_ctl;
-       u64 cbox_stp_ctl;
-       u64 zbox0_error_pa;
-       u64 zbox1_error_pa;
-       u64 zbox0_ored_syndrome;
-       u64 zbox1_ored_syndrome;
-       u64 reserved3[2];
-};
-
-/*
- * Data for el packet class PAL (14), type EV7_RBOX (6)
- */
-struct ev7_pal_rbox_subpacket {
-       u64 rbox_cfg;
-       u64 rbox_n_cfg;
-       u64 rbox_s_cfg;
-       u64 rbox_e_cfg;
-       u64 rbox_w_cfg;
-       u64 rbox_n_err;
-       u64 rbox_s_err;
-       u64 rbox_e_err;
-       u64 rbox_w_err;
-       u64 rbox_io_cfg;
-       u64 rbox_io_err;
-       u64 rbox_l_err;
-       u64 rbox_whoami;
-       u64 rbox_imask;
-       u64 rbox_intq;
-       u64 rbox_int;
-       u64 reserved[2];
-};
-
-/*
- * Data for el packet class PAL (14), type EV7_IO (7)
- */
-struct ev7_pal_io_one_port {
-       u64 pox_err_sum;
-       u64 pox_tlb_err;
-       u64 pox_spl_cmplt;
-       u64 pox_trans_sum;
-       u64 pox_first_err;
-       u64 pox_mult_err;
-       u64 pox_dm_source;
-       u64 pox_dm_dest;
-       u64 pox_dm_size;
-       u64 pox_dm_ctrl;
-       u64 reserved;
-};
-
-struct ev7_pal_io_subpacket {
-       u64 io_asic_rev;
-       u64 io_sys_rev;
-       u64 io7_uph;
-       u64 hpi_ctl;
-       u64 crd_ctl;
-       u64 hei_ctl;
-       u64 po7_error_sum;
-       u64 po7_uncrr_sym;
-       u64 po7_crrct_sym;
-       u64 po7_ugbge_sym;
-       u64 po7_err_pkt0;
-       u64 po7_err_pkt1;
-       u64 reserved[2];
-       struct ev7_pal_io_one_port ports[4];
-};
-
-/*
- * Environmental subpacket. Data used for el packets:
- *        class PAL (14), type AMBIENT_TEMPERATURE (10)
- *        class PAL (14), type AIRMOVER_FAN (11)
- *        class PAL (14), type VOLTAGE (12)
- *        class PAL (14), type INTRUSION (13)
- *        class PAL (14), type POWER_SUPPLY (14)
- *        class PAL (14), type LAN (15)
- *        class PAL (14), type HOT_PLUG (16)
- */
-struct ev7_pal_environmental_subpacket {
-       u16 cabinet;
-       u16 drawer;
-       u16 reserved1[2];
-       u8 module_type;
-       u8 unit_id;             /* unit reporting condition */
-       u8 reserved2;
-       u8 condition;           /* condition reported       */
-};
-
-/*
- * Convert environmental type to index
- */
-static inline int ev7_lf_env_index(int type)
-{
-       BUG_ON((type < EL_TYPE__PAL__ENV__AMBIENT_TEMPERATURE) 
-              || (type > EL_TYPE__PAL__ENV__HOT_PLUG));
-
-       return type - EL_TYPE__PAL__ENV__AMBIENT_TEMPERATURE;
-}
-
-/*
- * Data for generic el packet class PAL.
- */
-struct ev7_pal_subpacket {
-       union {
-               struct ev7_pal_logout_subpacket logout;      /* Type     1 */
-               struct ev7_pal_processor_subpacket ev7;      /* Type     4 */
-               struct ev7_pal_zbox_subpacket zbox;          /* Type     5 */
-               struct ev7_pal_rbox_subpacket rbox;          /* Type     6 */
-               struct ev7_pal_io_subpacket io;              /* Type     7 */
-               struct ev7_pal_environmental_subpacket env;  /* Type 10-16 */
-               u64 as_quad[1];                              /* Raw u64    */
-       } by_type;
-};
-
-/*
- * Struct to contain collected logout from subpackets.
- */
-struct ev7_lf_subpackets {
-       struct ev7_pal_logout_subpacket *logout;                /* Type  1 */
-       struct ev7_pal_processor_subpacket *ev7;                /* Type  4 */
-       struct ev7_pal_zbox_subpacket *zbox;                    /* Type  5 */
-       struct ev7_pal_rbox_subpacket *rbox;                    /* Type  6 */
-       struct ev7_pal_io_subpacket *io;                        /* Type  7 */
-       struct ev7_pal_environmental_subpacket *env[7];      /* Type 10-16 */
-
-       unsigned int io_pid;
-};
-
-#endif /* __ALPHA_ERR_EV7_H */
-
-
diff --git a/include/asm-alpha/errno.h b/include/asm-alpha/errno.h
deleted file mode 100644 (file)
index 69e2655..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#ifndef _ALPHA_ERRNO_H
-#define _ALPHA_ERRNO_H
-
-#include <asm-generic/errno-base.h>
-
-#undef EAGAIN                  /* 11 in errno-base.h */
-
-#define        EDEADLK         11      /* Resource deadlock would occur */
-
-#define        EAGAIN          35      /* Try again */
-#define        EWOULDBLOCK     EAGAIN  /* Operation would block */
-#define        EINPROGRESS     36      /* Operation now in progress */
-#define        EALREADY        37      /* Operation already in progress */
-#define        ENOTSOCK        38      /* Socket operation on non-socket */
-#define        EDESTADDRREQ    39      /* Destination address required */
-#define        EMSGSIZE        40      /* Message too long */
-#define        EPROTOTYPE      41      /* Protocol wrong type for socket */
-#define        ENOPROTOOPT     42      /* Protocol not available */
-#define        EPROTONOSUPPORT 43      /* Protocol not supported */
-#define        ESOCKTNOSUPPORT 44      /* Socket type not supported */
-#define        EOPNOTSUPP      45      /* Operation not supported on transport endpoint */
-#define        EPFNOSUPPORT    46      /* Protocol family not supported */
-#define        EAFNOSUPPORT    47      /* Address family not supported by protocol */
-#define        EADDRINUSE      48      /* Address already in use */
-#define        EADDRNOTAVAIL   49      /* Cannot assign requested address */
-#define        ENETDOWN        50      /* Network is down */
-#define        ENETUNREACH     51      /* Network is unreachable */
-#define        ENETRESET       52      /* Network dropped connection because of reset */
-#define        ECONNABORTED    53      /* Software caused connection abort */
-#define        ECONNRESET      54      /* Connection reset by peer */
-#define        ENOBUFS         55      /* No buffer space available */
-#define        EISCONN         56      /* Transport endpoint is already connected */
-#define        ENOTCONN        57      /* Transport endpoint is not connected */
-#define        ESHUTDOWN       58      /* Cannot send after transport endpoint shutdown */
-#define        ETOOMANYREFS    59      /* Too many references: cannot splice */
-#define        ETIMEDOUT       60      /* Connection timed out */
-#define        ECONNREFUSED    61      /* Connection refused */
-#define        ELOOP           62      /* Too many symbolic links encountered */
-#define        ENAMETOOLONG    63      /* File name too long */
-#define        EHOSTDOWN       64      /* Host is down */
-#define        EHOSTUNREACH    65      /* No route to host */
-#define        ENOTEMPTY       66      /* Directory not empty */
-
-#define        EUSERS          68      /* Too many users */
-#define        EDQUOT          69      /* Quota exceeded */
-#define        ESTALE          70      /* Stale NFS file handle */
-#define        EREMOTE         71      /* Object is remote */
-
-#define        ENOLCK          77      /* No record locks available */
-#define        ENOSYS          78      /* Function not implemented */
-
-#define        ENOMSG          80      /* No message of desired type */
-#define        EIDRM           81      /* Identifier removed */
-#define        ENOSR           82      /* Out of streams resources */
-#define        ETIME           83      /* Timer expired */
-#define        EBADMSG         84      /* Not a data message */
-#define        EPROTO          85      /* Protocol error */
-#define        ENODATA         86      /* No data available */
-#define        ENOSTR          87      /* Device not a stream */
-
-#define        ENOPKG          92      /* Package not installed */
-
-#define        EILSEQ          116     /* Illegal byte sequence */
-
-/* The following are just random noise.. */
-#define        ECHRNG          88      /* Channel number out of range */
-#define        EL2NSYNC        89      /* Level 2 not synchronized */
-#define        EL3HLT          90      /* Level 3 halted */
-#define        EL3RST          91      /* Level 3 reset */
-
-#define        ELNRNG          93      /* Link number out of range */
-#define        EUNATCH         94      /* Protocol driver not attached */
-#define        ENOCSI          95      /* No CSI structure available */
-#define        EL2HLT          96      /* Level 2 halted */
-#define        EBADE           97      /* Invalid exchange */
-#define        EBADR           98      /* Invalid request descriptor */
-#define        EXFULL          99      /* Exchange full */
-#define        ENOANO          100     /* No anode */
-#define        EBADRQC         101     /* Invalid request code */
-#define        EBADSLT         102     /* Invalid slot */
-
-#define        EDEADLOCK       EDEADLK
-
-#define        EBFONT          104     /* Bad font file format */
-#define        ENONET          105     /* Machine is not on the network */
-#define        ENOLINK         106     /* Link has been severed */
-#define        EADV            107     /* Advertise error */
-#define        ESRMNT          108     /* Srmount error */
-#define        ECOMM           109     /* Communication error on send */
-#define        EMULTIHOP       110     /* Multihop attempted */
-#define        EDOTDOT         111     /* RFS specific error */
-#define        EOVERFLOW       112     /* Value too large for defined data type */
-#define        ENOTUNIQ        113     /* Name not unique on network */
-#define        EBADFD          114     /* File descriptor in bad state */
-#define        EREMCHG         115     /* Remote address changed */
-
-#define        EUCLEAN         117     /* Structure needs cleaning */
-#define        ENOTNAM         118     /* Not a XENIX named type file */
-#define        ENAVAIL         119     /* No XENIX semaphores available */
-#define        EISNAM          120     /* Is a named type file */
-#define        EREMOTEIO       121     /* Remote I/O error */
-
-#define        ELIBACC         122     /* Can not access a needed shared library */
-#define        ELIBBAD         123     /* Accessing a corrupted shared library */
-#define        ELIBSCN         124     /* .lib section in a.out corrupted */
-#define        ELIBMAX         125     /* Attempting to link in too many shared libraries */
-#define        ELIBEXEC        126     /* Cannot exec a shared library directly */
-#define        ERESTART        127     /* Interrupted system call should be restarted */
-#define        ESTRPIPE        128     /* Streams pipe error */
-
-#define ENOMEDIUM      129     /* No medium found */
-#define EMEDIUMTYPE    130     /* Wrong medium type */
-#define        ECANCELED       131     /* Operation Cancelled */
-#define        ENOKEY          132     /* Required key not available */
-#define        EKEYEXPIRED     133     /* Key has expired */
-#define        EKEYREVOKED     134     /* Key has been revoked */
-#define        EKEYREJECTED    135     /* Key was rejected by service */
-
-/* for robust mutexes */
-#define        EOWNERDEAD      136     /* Owner died */
-#define        ENOTRECOVERABLE 137     /* State not recoverable */
-
-#endif
diff --git a/include/asm-alpha/fb.h b/include/asm-alpha/fb.h
deleted file mode 100644 (file)
index fa9bbb9..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _ASM_FB_H_
-#define _ASM_FB_H_
-#include <linux/device.h>
-
-/* Caching is off in the I/O space quadrant by design.  */
-#define fb_pgprotect(...) do {} while (0)
-
-static inline int fb_is_primary_device(struct fb_info *info)
-{
-       return 0;
-}
-
-#endif /* _ASM_FB_H_ */
diff --git a/include/asm-alpha/fcntl.h b/include/asm-alpha/fcntl.h
deleted file mode 100644 (file)
index 25da001..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef _ALPHA_FCNTL_H
-#define _ALPHA_FCNTL_H
-
-/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
-   located on an ext2 file system */
-#define O_CREAT                 01000  /* not fcntl */
-#define O_TRUNC                 02000  /* not fcntl */
-#define O_EXCL          04000  /* not fcntl */
-#define O_NOCTTY       010000  /* not fcntl */
-
-#define O_NONBLOCK      00004
-#define O_APPEND        00010
-#define O_SYNC         040000
-#define O_DIRECTORY    0100000 /* must be a directory */
-#define O_NOFOLLOW     0200000 /* don't follow links */
-#define O_LARGEFILE    0400000 /* will be set by the kernel on every open */
-#define O_DIRECT       02000000 /* direct disk access - should check with OSF/1 */
-#define O_NOATIME      04000000
-#define O_CLOEXEC      010000000 /* set close_on_exec */
-
-#define F_GETLK                7
-#define F_SETLK                8
-#define F_SETLKW       9
-
-#define F_SETOWN       5       /*  for sockets. */
-#define F_GETOWN       6       /*  for sockets. */
-#define F_SETSIG       10      /*  for sockets. */
-#define F_GETSIG       11      /*  for sockets. */
-
-/* for posix fcntl() and lockf() */
-#define F_RDLCK                1
-#define F_WRLCK                2
-#define F_UNLCK                8
-
-/* for old implementation of bsd flock () */
-#define F_EXLCK                16      /* or 3 */
-#define F_SHLCK                32      /* or 4 */
-
-#define F_INPROGRESS   64
-
-#include <asm-generic/fcntl.h>
-
-#endif
diff --git a/include/asm-alpha/floppy.h b/include/asm-alpha/floppy.h
deleted file mode 100644 (file)
index 0be5041..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Architecture specific parts of the Floppy driver
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1995
- */
-#ifndef __ASM_ALPHA_FLOPPY_H
-#define __ASM_ALPHA_FLOPPY_H
-
-
-#define fd_inb(port)                   inb_p(port)
-#define fd_outb(value,port)            outb_p(value,port)
-
-#define fd_enable_dma()         enable_dma(FLOPPY_DMA)
-#define fd_disable_dma()        disable_dma(FLOPPY_DMA)
-#define fd_request_dma()        request_dma(FLOPPY_DMA,"floppy")
-#define fd_free_dma()           free_dma(FLOPPY_DMA)
-#define fd_clear_dma_ff()       clear_dma_ff(FLOPPY_DMA)
-#define fd_set_dma_mode(mode)   set_dma_mode(FLOPPY_DMA,mode)
-#define fd_set_dma_addr(addr)   set_dma_addr(FLOPPY_DMA,virt_to_bus(addr))
-#define fd_set_dma_count(count) set_dma_count(FLOPPY_DMA,count)
-#define fd_enable_irq()         enable_irq(FLOPPY_IRQ)
-#define fd_disable_irq()        disable_irq(FLOPPY_IRQ)
-#define fd_cacheflush(addr,size) /* nothing */
-#define fd_request_irq()        request_irq(FLOPPY_IRQ, floppy_interrupt,\
-                                           IRQF_DISABLED, "floppy", NULL)
-#define fd_free_irq()           free_irq(FLOPPY_IRQ, NULL);
-
-#ifdef CONFIG_PCI
-
-#include <linux/pci.h>
-
-#define fd_dma_setup(addr,size,mode,io) alpha_fd_dma_setup(addr,size,mode,io)
-
-static __inline__ int 
-alpha_fd_dma_setup(char *addr, unsigned long size, int mode, int io)
-{
-       static unsigned long prev_size;
-       static dma_addr_t bus_addr = 0;
-       static char *prev_addr;
-       static int prev_dir;
-       int dir;
-
-       dir = (mode != DMA_MODE_READ) ? PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE;
-
-       if (bus_addr 
-           && (addr != prev_addr || size != prev_size || dir != prev_dir)) {
-               /* different from last time -- unmap prev */
-               pci_unmap_single(isa_bridge, bus_addr, prev_size, prev_dir);
-               bus_addr = 0;
-       }
-
-       if (!bus_addr)  /* need to map it */
-               bus_addr = pci_map_single(isa_bridge, addr, size, dir);
-
-       /* remember this one as prev */
-       prev_addr = addr;
-       prev_size = size;
-       prev_dir = dir;
-
-       fd_clear_dma_ff();
-       fd_cacheflush(addr, size);
-       fd_set_dma_mode(mode);
-       set_dma_addr(FLOPPY_DMA, bus_addr);
-       fd_set_dma_count(size);
-       virtual_dma_port = io;
-       fd_enable_dma();
-
-       return 0;
-}
-
-#endif /* CONFIG_PCI */
-
-__inline__ void virtual_dma_init(void)
-{
-       /* Nothing to do on an Alpha */
-}
-
-static int FDC1 = 0x3f0;
-static int FDC2 = -1;
-
-/*
- * Again, the CMOS information doesn't work on the alpha..
- */
-#define FLOPPY0_TYPE 6
-#define FLOPPY1_TYPE 0
-
-#define N_FDC 2
-#define N_DRIVE 8
-
-/*
- * Most Alphas have no problems with floppy DMA crossing 64k borders,
- * except for certain ones, like XL and RUFFIAN.
- *
- * However, the test is simple and fast, and this *is* floppy, after all,
- * so we do it for all platforms, just to make sure.
- *
- * This is advantageous in other circumstances as well, as in moving
- * about the PCI DMA windows and forcing the floppy to start doing
- * scatter-gather when it never had before, and there *is* a problem
- * on that platform... ;-}
- */
-
-static inline unsigned long CROSS_64KB(void *a, unsigned long s)
-{
-       unsigned long p = (unsigned long)a;
-       return ((p + s - 1) ^ p) & ~0xffffUL;
-}
-
-#define EXTRA_FLOPPY_PARAMS
-
-#endif /* __ASM_ALPHA_FLOPPY_H */
diff --git a/include/asm-alpha/fpu.h b/include/asm-alpha/fpu.h
deleted file mode 100644 (file)
index ecb17a7..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-#ifndef __ASM_ALPHA_FPU_H
-#define __ASM_ALPHA_FPU_H
-
-/*
- * Alpha floating-point control register defines:
- */
-#define FPCR_DNOD      (1UL<<47)       /* denorm INV trap disable */
-#define FPCR_DNZ       (1UL<<48)       /* denorms to zero */
-#define FPCR_INVD      (1UL<<49)       /* invalid op disable (opt.) */
-#define FPCR_DZED      (1UL<<50)       /* division by zero disable (opt.) */
-#define FPCR_OVFD      (1UL<<51)       /* overflow disable (optional) */
-#define FPCR_INV       (1UL<<52)       /* invalid operation */
-#define FPCR_DZE       (1UL<<53)       /* division by zero */
-#define FPCR_OVF       (1UL<<54)       /* overflow */
-#define FPCR_UNF       (1UL<<55)       /* underflow */
-#define FPCR_INE       (1UL<<56)       /* inexact */
-#define FPCR_IOV       (1UL<<57)       /* integer overflow */
-#define FPCR_UNDZ      (1UL<<60)       /* underflow to zero (opt.) */
-#define FPCR_UNFD      (1UL<<61)       /* underflow disable (opt.) */
-#define FPCR_INED      (1UL<<62)       /* inexact disable (opt.) */
-#define FPCR_SUM       (1UL<<63)       /* summary bit */
-
-#define FPCR_DYN_SHIFT 58              /* first dynamic rounding mode bit */
-#define FPCR_DYN_CHOPPED (0x0UL << FPCR_DYN_SHIFT)     /* towards 0 */
-#define FPCR_DYN_MINUS  (0x1UL << FPCR_DYN_SHIFT)      /* towards -INF */
-#define FPCR_DYN_NORMAL         (0x2UL << FPCR_DYN_SHIFT)      /* towards nearest */
-#define FPCR_DYN_PLUS   (0x3UL << FPCR_DYN_SHIFT)      /* towards +INF */
-#define FPCR_DYN_MASK   (0x3UL << FPCR_DYN_SHIFT)
-
-#define FPCR_MASK      0xffff800000000000L
-
-/*
- * IEEE trap enables are implemented in software.  These per-thread
- * bits are stored in the "ieee_state" field of "struct thread_info".
- * Thus, the bits are defined so as not to conflict with the
- * floating-point enable bit (which is architected).  On top of that,
- * we want to make these bits compatible with OSF/1 so
- * ieee_set_fp_control() etc. can be implemented easily and
- * compatibly.  The corresponding definitions are in
- * /usr/include/machine/fpu.h under OSF/1.
- */
-#define IEEE_TRAP_ENABLE_INV   (1UL<<1)        /* invalid op */
-#define IEEE_TRAP_ENABLE_DZE   (1UL<<2)        /* division by zero */
-#define IEEE_TRAP_ENABLE_OVF   (1UL<<3)        /* overflow */
-#define IEEE_TRAP_ENABLE_UNF   (1UL<<4)        /* underflow */
-#define IEEE_TRAP_ENABLE_INE   (1UL<<5)        /* inexact */
-#define IEEE_TRAP_ENABLE_DNO   (1UL<<6)        /* denorm */
-#define IEEE_TRAP_ENABLE_MASK  (IEEE_TRAP_ENABLE_INV | IEEE_TRAP_ENABLE_DZE |\
-                                IEEE_TRAP_ENABLE_OVF | IEEE_TRAP_ENABLE_UNF |\
-                                IEEE_TRAP_ENABLE_INE | IEEE_TRAP_ENABLE_DNO)
-
-/* Denorm and Underflow flushing */
-#define IEEE_MAP_DMZ           (1UL<<12)       /* Map denorm inputs to zero */
-#define IEEE_MAP_UMZ           (1UL<<13)       /* Map underflowed outputs to zero */
-
-#define IEEE_MAP_MASK          (IEEE_MAP_DMZ | IEEE_MAP_UMZ)
-
-/* status bits coming from fpcr: */
-#define IEEE_STATUS_INV                (1UL<<17)
-#define IEEE_STATUS_DZE                (1UL<<18)
-#define IEEE_STATUS_OVF                (1UL<<19)
-#define IEEE_STATUS_UNF                (1UL<<20)
-#define IEEE_STATUS_INE                (1UL<<21)
-#define IEEE_STATUS_DNO                (1UL<<22)
-
-#define IEEE_STATUS_MASK       (IEEE_STATUS_INV | IEEE_STATUS_DZE |    \
-                                IEEE_STATUS_OVF | IEEE_STATUS_UNF |    \
-                                IEEE_STATUS_INE | IEEE_STATUS_DNO)
-
-#define IEEE_SW_MASK           (IEEE_TRAP_ENABLE_MASK |                \
-                                IEEE_STATUS_MASK | IEEE_MAP_MASK)
-
-#define IEEE_CURRENT_RM_SHIFT  32
-#define IEEE_CURRENT_RM_MASK   (3UL<<IEEE_CURRENT_RM_SHIFT)
-
-#define IEEE_STATUS_TO_EXCSUM_SHIFT    16
-
-#define IEEE_INHERIT    (1UL<<63)      /* inherit on thread create? */
-
-/*
- * Convert the software IEEE trap enable and status bits into the
- * hardware fpcr format. 
- *
- * Digital Unix engineers receive my thanks for not defining the
- * software bits identical to the hardware bits.  The chip designers
- * receive my thanks for making all the not-implemented fpcr bits
- * RAZ forcing us to use system calls to read/write this value.
- */
-
-static inline unsigned long
-ieee_swcr_to_fpcr(unsigned long sw)
-{
-       unsigned long fp;
-       fp = (sw & IEEE_STATUS_MASK) << 35;
-       fp |= (sw & IEEE_MAP_DMZ) << 36;
-       fp |= (sw & IEEE_STATUS_MASK ? FPCR_SUM : 0);
-       fp |= (~sw & (IEEE_TRAP_ENABLE_INV
-                     | IEEE_TRAP_ENABLE_DZE
-                     | IEEE_TRAP_ENABLE_OVF)) << 48;
-       fp |= (~sw & (IEEE_TRAP_ENABLE_UNF | IEEE_TRAP_ENABLE_INE)) << 57;
-       fp |= (sw & IEEE_MAP_UMZ ? FPCR_UNDZ | FPCR_UNFD : 0);
-       fp |= (~sw & IEEE_TRAP_ENABLE_DNO) << 41;
-       return fp;
-}
-
-static inline unsigned long
-ieee_fpcr_to_swcr(unsigned long fp)
-{
-       unsigned long sw;
-       sw = (fp >> 35) & IEEE_STATUS_MASK;
-       sw |= (fp >> 36) & IEEE_MAP_DMZ;
-       sw |= (~fp >> 48) & (IEEE_TRAP_ENABLE_INV
-                            | IEEE_TRAP_ENABLE_DZE
-                            | IEEE_TRAP_ENABLE_OVF);
-       sw |= (~fp >> 57) & (IEEE_TRAP_ENABLE_UNF | IEEE_TRAP_ENABLE_INE);
-       sw |= (fp >> 47) & IEEE_MAP_UMZ;
-       sw |= (~fp >> 41) & IEEE_TRAP_ENABLE_DNO;
-       return sw;
-}
-
-#ifdef __KERNEL__
-
-/* The following two functions don't need trapb/excb instructions
-   around the mf_fpcr/mt_fpcr instructions because (a) the kernel
-   never generates arithmetic faults and (b) call_pal instructions
-   are implied trap barriers.  */
-
-static inline unsigned long
-rdfpcr(void)
-{
-       unsigned long tmp, ret;
-
-#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
-       __asm__ __volatile__ (
-               "ftoit $f0,%0\n\t"
-               "mf_fpcr $f0\n\t"
-               "ftoit $f0,%1\n\t"
-               "itoft %0,$f0"
-               : "=r"(tmp), "=r"(ret));
-#else
-       __asm__ __volatile__ (
-               "stt $f0,%0\n\t"
-               "mf_fpcr $f0\n\t"
-               "stt $f0,%1\n\t"
-               "ldt $f0,%0"
-               : "=m"(tmp), "=m"(ret));
-#endif
-
-       return ret;
-}
-
-static inline void
-wrfpcr(unsigned long val)
-{
-       unsigned long tmp;
-
-#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
-       __asm__ __volatile__ (
-               "ftoit $f0,%0\n\t"
-               "itoft %1,$f0\n\t"
-               "mt_fpcr $f0\n\t"
-               "itoft %0,$f0"
-               : "=&r"(tmp) : "r"(val));
-#else
-       __asm__ __volatile__ (
-               "stt $f0,%0\n\t"
-               "ldt $f0,%1\n\t"
-               "mt_fpcr $f0\n\t"
-               "ldt $f0,%0"
-               : "=m"(tmp) : "m"(val));
-#endif
-}
-
-static inline unsigned long
-swcr_update_status(unsigned long swcr, unsigned long fpcr)
-{
-       /* EV6 implements most of the bits in hardware.  Collect
-          the acrued exception bits from the real fpcr.  */
-       if (implver() == IMPLVER_EV6) {
-               swcr &= ~IEEE_STATUS_MASK;
-               swcr |= (fpcr >> 35) & IEEE_STATUS_MASK;
-       }
-       return swcr;
-}
-
-extern unsigned long alpha_read_fp_reg (unsigned long reg);
-extern void alpha_write_fp_reg (unsigned long reg, unsigned long val);
-extern unsigned long alpha_read_fp_reg_s (unsigned long reg);
-extern void alpha_write_fp_reg_s (unsigned long reg, unsigned long val);
-
-#endif /* __KERNEL__ */
-
-#endif /* __ASM_ALPHA_FPU_H */
diff --git a/include/asm-alpha/futex.h b/include/asm-alpha/futex.h
deleted file mode 100644 (file)
index 6a332a9..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_FUTEX_H
-#define _ASM_FUTEX_H
-
-#include <asm-generic/futex.h>
-
-#endif
diff --git a/include/asm-alpha/gct.h b/include/asm-alpha/gct.h
deleted file mode 100644 (file)
index 3504c70..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef __ALPHA_GCT_H
-#define __ALPHA_GCT_H
-
-typedef u64 gct_id;
-typedef u64 gct6_handle;
-
-typedef struct __gct6_node {
-       u8 type;        
-       u8 subtype;
-       u16 size;
-       u32 hd_extension;
-       gct6_handle owner;
-       gct6_handle active_user;
-       gct_id id;
-       u64 flags;
-       u16 rev;
-       u16 change_counter;
-       u16 max_child;
-       u16 reserved1;
-       gct6_handle saved_owner;
-       gct6_handle affinity;
-       gct6_handle parent;
-       gct6_handle next;
-       gct6_handle prev;
-       gct6_handle child;
-       u64 fw_flags;
-       u64 os_usage;
-       u64 fru_id;
-       u32 checksum;
-       u32 magic;      /* 'GLXY' */
-} gct6_node;
-
-typedef struct {
-       u8 type;        
-       u8 subtype;
-       void (*callout)(gct6_node *);
-} gct6_search_struct;
-
-#define GCT_NODE_MAGIC   0x59584c47    /* 'GLXY' */
-
-/* 
- * node types 
- */
-#define GCT_TYPE_HOSE                  0x0E
-
-/*
- * node subtypes
- */
-#define GCT_SUBTYPE_IO_PORT_MODULE     0x2C
-
-#define GCT_NODE_PTR(off) ((gct6_node *)((char *)hwrpb +               \
-                                        hwrpb->frut_offset +           \
-                                        (gct6_handle)(off)))           \
-
-int gct6_find_nodes(gct6_node *, gct6_search_struct *);
-
-#endif /* __ALPHA_GCT_H */
-
diff --git a/include/asm-alpha/gentrap.h b/include/asm-alpha/gentrap.h
deleted file mode 100644 (file)
index ae50cc3..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef _ASMAXP_GENTRAP_H
-#define _ASMAXP_GENTRAP_H
-
-/*
- * Definitions for gentrap causes.  They are generated by user-level
- * programs and therefore should be compatible with the corresponding
- * OSF/1 definitions.
- */
-#define GEN_INTOVF     -1      /* integer overflow */
-#define GEN_INTDIV     -2      /* integer division by zero */
-#define GEN_FLTOVF     -3      /* fp overflow */
-#define GEN_FLTDIV     -4      /* fp division by zero */
-#define GEN_FLTUND     -5      /* fp underflow */
-#define GEN_FLTINV     -6      /* invalid fp operand */
-#define GEN_FLTINE     -7      /* inexact fp operand */
-#define GEN_DECOVF     -8      /* decimal overflow (for COBOL??) */
-#define GEN_DECDIV     -9      /* decimal division by zero */
-#define GEN_DECINV     -10     /* invalid decimal operand */
-#define GEN_ROPRAND    -11     /* reserved operand */
-#define GEN_ASSERTERR  -12     /* assertion error */
-#define GEN_NULPTRERR  -13     /* null pointer error */
-#define GEN_STKOVF     -14     /* stack overflow */
-#define GEN_STRLENERR  -15     /* string length error */
-#define GEN_SUBSTRERR  -16     /* substring error */
-#define GEN_RANGERR    -17     /* range error */
-#define GEN_SUBRNG     -18
-#define GEN_SUBRNG1    -19      
-#define GEN_SUBRNG2    -20
-#define GEN_SUBRNG3    -21     /* these report range errors for */
-#define GEN_SUBRNG4    -22     /* subscripting (indexing) at levels 0..7 */
-#define GEN_SUBRNG5    -23
-#define GEN_SUBRNG6    -24
-#define GEN_SUBRNG7    -25
-
-/* the remaining codes (-26..-1023) are reserved. */
-
-#endif /* _ASMAXP_GENTRAP_H */
diff --git a/include/asm-alpha/hardirq.h b/include/asm-alpha/hardirq.h
deleted file mode 100644 (file)
index d953e23..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef _ALPHA_HARDIRQ_H
-#define _ALPHA_HARDIRQ_H
-
-#include <linux/threads.h>
-#include <linux/cache.h>
-
-
-/* entry.S is sensitive to the offsets of these fields */
-typedef struct {
-       unsigned long __softirq_pending;
-} ____cacheline_aligned irq_cpustat_t;
-
-#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
-
-void ack_bad_irq(unsigned int irq);
-
-#define HARDIRQ_BITS   12
-
-/*
- * The hardirq mask has to be large enough to have
- * space for potentially nestable IRQ sources in the system
- * to nest on a single CPU. On Alpha, interrupts are masked at the CPU
- * by IPL as well as at the system level. We only have 8 IPLs (UNIX PALcode)
- * so we really only have 8 nestable IRQs, but allow some overhead
- */
-#if (1 << HARDIRQ_BITS) < 16
-#error HARDIRQ_BITS is too low!
-#endif
-
-#endif /* _ALPHA_HARDIRQ_H */
diff --git a/include/asm-alpha/hw_irq.h b/include/asm-alpha/hw_irq.h
deleted file mode 100644 (file)
index a37db0f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _ALPHA_HW_IRQ_H
-#define _ALPHA_HW_IRQ_H
-
-
-extern volatile unsigned long irq_err_count;
-
-#ifdef CONFIG_ALPHA_GENERIC
-#define ACTUAL_NR_IRQS alpha_mv.nr_irqs
-#else
-#define ACTUAL_NR_IRQS NR_IRQS
-#endif
-
-#endif
diff --git a/include/asm-alpha/hwrpb.h b/include/asm-alpha/hwrpb.h
deleted file mode 100644 (file)
index 8e8f871..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-#ifndef __ALPHA_HWRPB_H
-#define __ALPHA_HWRPB_H
-
-#define INIT_HWRPB ((struct hwrpb_struct *) 0x10000000)
-
-/*
- * DEC processor types for Alpha systems.  Found in HWRPB.
- * These values are architected.
- */
-
-#define EV3_CPU                 1       /* EV3                  */
-#define EV4_CPU                 2       /* EV4 (21064)          */
-#define LCA4_CPU                4       /* LCA4 (21066/21068)   */
-#define EV5_CPU                 5       /* EV5 (21164)          */
-#define EV45_CPU                6       /* EV4.5 (21064/xxx)    */
-#define EV56_CPU               7       /* EV5.6 (21164)        */
-#define EV6_CPU                        8       /* EV6 (21264)          */
-#define PCA56_CPU              9       /* PCA56 (21164PC)      */
-#define PCA57_CPU              10      /* PCA57 (notyet)       */
-#define EV67_CPU               11      /* EV67 (21264A)        */
-#define EV68CB_CPU             12      /* EV68CB (21264C)      */
-#define EV68AL_CPU             13      /* EV68AL (21264B)      */
-#define EV68CX_CPU             14      /* EV68CX (21264D)      */
-#define EV7_CPU                        15      /* EV7 (21364)          */
-#define EV79_CPU               16      /* EV79 (21364??)       */
-#define EV69_CPU               17      /* EV69 (21264/EV69A)   */
-
-/*
- * DEC system types for Alpha systems.  Found in HWRPB.
- * These values are architected.
- */
-
-#define ST_ADU                   1     /* Alpha ADU systype    */
-#define ST_DEC_4000              2     /* Cobra systype        */
-#define ST_DEC_7000              3     /* Ruby systype         */
-#define ST_DEC_3000_500                  4     /* Flamingo systype     */
-#define ST_DEC_2000_300                  6     /* Jensen systype       */
-#define ST_DEC_3000_300                  7     /* Pelican systype      */
-#define ST_DEC_2100_A500         9     /* Sable systype        */
-#define ST_DEC_AXPVME_64        10     /* AXPvme system type   */
-#define ST_DEC_AXPPCI_33        11     /* NoName system type   */
-#define ST_DEC_TLASER           12     /* Turbolaser systype   */
-#define ST_DEC_2100_A50                 13     /* Avanti systype       */
-#define ST_DEC_MUSTANG          14     /* Mustang systype      */
-#define ST_DEC_ALCOR            15     /* Alcor (EV5) systype  */
-#define ST_DEC_1000             17     /* Mikasa systype       */
-#define ST_DEC_EB64             18     /* EB64 systype         */
-#define ST_DEC_EB66             19     /* EB66 systype         */
-#define ST_DEC_EB64P            20     /* EB64+ systype        */
-#define ST_DEC_BURNS            21     /* laptop systype       */
-#define ST_DEC_RAWHIDE          22     /* Rawhide systype      */
-#define ST_DEC_K2               23     /* K2 systype           */
-#define ST_DEC_LYNX             24     /* Lynx systype         */
-#define ST_DEC_XL               25     /* Alpha XL systype     */
-#define ST_DEC_EB164            26     /* EB164 systype        */
-#define ST_DEC_NORITAKE                 27     /* Noritake systype     */
-#define ST_DEC_CORTEX           28     /* Cortex systype       */
-#define ST_DEC_MIATA            30     /* Miata systype        */
-#define ST_DEC_XXM              31     /* XXM systype          */
-#define ST_DEC_TAKARA           32     /* Takara systype       */
-#define ST_DEC_YUKON            33     /* Yukon systype        */
-#define ST_DEC_TSUNAMI          34     /* Tsunami systype      */
-#define ST_DEC_WILDFIRE                 35     /* Wildfire systype     */
-#define ST_DEC_CUSCO            36     /* CUSCO systype        */
-#define ST_DEC_EIGER            37     /* Eiger systype        */
-#define ST_DEC_TITAN            38     /* Titan systype        */
-#define ST_DEC_MARVEL           39     /* Marvel systype       */
-
-/* UNOFFICIAL!!! */
-#define ST_UNOFFICIAL_BIAS     100
-#define ST_DTI_RUFFIAN         101     /* RUFFIAN systype      */
-
-/* Alpha Processor, Inc. systems */
-#define ST_API_BIAS            200
-#define ST_API_NAUTILUS                201     /* UP1000 systype       */
-
-struct pcb_struct {
-       unsigned long ksp;
-       unsigned long usp;
-       unsigned long ptbr;
-       unsigned int pcc;
-       unsigned int asn;
-       unsigned long unique;
-       unsigned long flags;
-       unsigned long res1, res2;
-};
-
-struct percpu_struct {
-       unsigned long hwpcb[16];
-       unsigned long flags;
-       unsigned long pal_mem_size;
-       unsigned long pal_scratch_size;
-       unsigned long pal_mem_pa;
-       unsigned long pal_scratch_pa;
-       unsigned long pal_revision;
-       unsigned long type;
-       unsigned long variation;
-       unsigned long revision;
-       unsigned long serial_no[2];
-       unsigned long logout_area_pa;
-       unsigned long logout_area_len;
-       unsigned long halt_PCBB;
-       unsigned long halt_PC;
-       unsigned long halt_PS;
-       unsigned long halt_arg;
-       unsigned long halt_ra;
-       unsigned long halt_pv;
-       unsigned long halt_reason;
-       unsigned long res;
-       unsigned long ipc_buffer[21];
-       unsigned long palcode_avail[16];
-       unsigned long compatibility;
-       unsigned long console_data_log_pa;
-       unsigned long console_data_log_length;
-       unsigned long bcache_info;
-};
-
-struct procdesc_struct {
-       unsigned long weird_vms_stuff;
-       unsigned long address;
-};
-
-struct vf_map_struct {
-       unsigned long va;
-       unsigned long pa;
-       unsigned long count;
-};
-
-struct crb_struct {
-       struct procdesc_struct * dispatch_va;
-       struct procdesc_struct * dispatch_pa;
-       struct procdesc_struct * fixup_va;
-       struct procdesc_struct * fixup_pa;
-       /* virtual->physical map */
-       unsigned long map_entries;
-       unsigned long map_pages;
-       struct vf_map_struct map[1];
-};
-
-struct memclust_struct {
-       unsigned long start_pfn;
-       unsigned long numpages;
-       unsigned long numtested;
-       unsigned long bitmap_va;
-       unsigned long bitmap_pa;
-       unsigned long bitmap_chksum;
-       unsigned long usage;
-};
-
-struct memdesc_struct {
-       unsigned long chksum;
-       unsigned long optional_pa;
-       unsigned long numclusters;
-       struct memclust_struct cluster[0];
-};
-
-struct dsr_struct {
-       long smm;                       /* SMM nubber used by LMF       */
-       unsigned long  lurt_off;        /* offset to LURT table         */
-       unsigned long  sysname_off;     /* offset to sysname char count */
-};
-
-struct hwrpb_struct {
-       unsigned long phys_addr;        /* check: physical address of the hwrpb */
-       unsigned long id;               /* check: "HWRPB\0\0\0" */
-       unsigned long revision; 
-       unsigned long size;             /* size of hwrpb */
-       unsigned long cpuid;
-       unsigned long pagesize;         /* 8192, I hope */
-       unsigned long pa_bits;          /* number of physical address bits */
-       unsigned long max_asn;
-       unsigned char ssn[16];          /* system serial number: big bother is watching */
-       unsigned long sys_type;
-       unsigned long sys_variation;
-       unsigned long sys_revision;
-       unsigned long intr_freq;        /* interval clock frequency * 4096 */
-       unsigned long cycle_freq;       /* cycle counter frequency */
-       unsigned long vptb;             /* Virtual Page Table Base address */
-       unsigned long res1;
-       unsigned long tbhb_offset;      /* Translation Buffer Hint Block */
-       unsigned long nr_processors;
-       unsigned long processor_size;
-       unsigned long processor_offset;
-       unsigned long ctb_nr;
-       unsigned long ctb_size;         /* console terminal block size */
-       unsigned long ctbt_offset;      /* console terminal block table offset */
-       unsigned long crb_offset;       /* console callback routine block */
-       unsigned long mddt_offset;      /* memory data descriptor table */
-       unsigned long cdb_offset;       /* configuration data block (or NULL) */
-       unsigned long frut_offset;      /* FRU table (or NULL) */
-       void (*save_terminal)(unsigned long);
-       unsigned long save_terminal_data;
-       void (*restore_terminal)(unsigned long);
-       unsigned long restore_terminal_data;
-       void (*CPU_restart)(unsigned long);
-       unsigned long CPU_restart_data;
-       unsigned long res2;
-       unsigned long res3;
-       unsigned long chksum;
-       unsigned long rxrdy;
-       unsigned long txrdy;
-       unsigned long dsr_offset;       /* "Dynamic System Recognition Data Block Table" */
-};
-
-#ifdef __KERNEL__
-
-extern struct hwrpb_struct *hwrpb;
-
-static inline void
-hwrpb_update_checksum(struct hwrpb_struct *h)
-{
-       unsigned long sum = 0, *l;
-        for (l = (unsigned long *) h; l < (unsigned long *) &h->chksum; ++l)
-                sum += *l;
-        h->chksum = sum;
-}
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_HWRPB_H */
diff --git a/include/asm-alpha/io.h b/include/asm-alpha/io.h
deleted file mode 100644 (file)
index e971ab0..0000000
+++ /dev/null
@@ -1,577 +0,0 @@
-#ifndef __ALPHA_IO_H
-#define __ALPHA_IO_H
-
-#ifdef __KERNEL__
-
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <asm/compiler.h>
-#include <asm/system.h>
-#include <asm/pgtable.h>
-#include <asm/machvec.h>
-#include <asm/hwrpb.h>
-
-/* The generic header contains only prototypes.  Including it ensures that
-   the implementation we have here matches that interface.  */
-#include <asm-generic/iomap.h>
-
-/* We don't use IO slowdowns on the Alpha, but.. */
-#define __SLOW_DOWN_IO do { } while (0)
-#define SLOW_DOWN_IO   do { } while (0)
-
-/*
- * Virtual -> physical identity mapping starts at this offset
- */
-#ifdef USE_48_BIT_KSEG
-#define IDENT_ADDR     0xffff800000000000UL
-#else
-#define IDENT_ADDR     0xfffffc0000000000UL
-#endif
-
-/*
- * We try to avoid hae updates (thus the cache), but when we
- * do need to update the hae, we need to do it atomically, so
- * that any interrupts wouldn't get confused with the hae
- * register not being up-to-date with respect to the hardware
- * value.
- */
-extern inline void __set_hae(unsigned long new_hae)
-{
-       unsigned long flags;
-       local_irq_save(flags);
-
-       alpha_mv.hae_cache = new_hae;
-       *alpha_mv.hae_register = new_hae;
-       mb();
-       /* Re-read to make sure it was written.  */
-       new_hae = *alpha_mv.hae_register;
-
-       local_irq_restore(flags);
-}
-
-extern inline void set_hae(unsigned long new_hae)
-{
-       if (new_hae != alpha_mv.hae_cache)
-               __set_hae(new_hae);
-}
-
-/*
- * Change virtual addresses to physical addresses and vv.
- */
-#ifdef USE_48_BIT_KSEG
-static inline unsigned long virt_to_phys(void *address)
-{
-       return (unsigned long)address - IDENT_ADDR;
-}
-
-static inline void * phys_to_virt(unsigned long address)
-{
-       return (void *) (address + IDENT_ADDR);
-}
-#else
-static inline unsigned long virt_to_phys(void *address)
-{
-        unsigned long phys = (unsigned long)address;
-
-       /* Sign-extend from bit 41.  */
-       phys <<= (64 - 41);
-       phys = (long)phys >> (64 - 41);
-
-       /* Crop to the physical address width of the processor.  */
-        phys &= (1ul << hwrpb->pa_bits) - 1;
-
-        return phys;
-}
-
-static inline void * phys_to_virt(unsigned long address)
-{
-        return (void *)(IDENT_ADDR + (address & ((1ul << 41) - 1)));
-}
-#endif
-
-#define page_to_phys(page)     page_to_pa(page)
-
-static inline dma_addr_t __deprecated isa_page_to_bus(struct page *page)
-{
-       return page_to_phys(page);
-}
-
-/* This depends on working iommu.  */
-#define BIO_VMERGE_BOUNDARY    (alpha_mv.mv_pci_tbi ? PAGE_SIZE : 0)
-
-/* Maximum PIO space address supported?  */
-#define IO_SPACE_LIMIT 0xffff
-
-/*
- * Change addresses as seen by the kernel (virtual) to addresses as
- * seen by a device (bus), and vice versa.
- *
- * Note that this only works for a limited range of kernel addresses,
- * and very well may not span all memory.  Consider this interface 
- * deprecated in favour of the DMA-mapping API.
- */
-extern unsigned long __direct_map_base;
-extern unsigned long __direct_map_size;
-
-static inline unsigned long __deprecated virt_to_bus(void *address)
-{
-       unsigned long phys = virt_to_phys(address);
-       unsigned long bus = phys + __direct_map_base;
-       return phys <= __direct_map_size ? bus : 0;
-}
-#define isa_virt_to_bus virt_to_bus
-
-static inline void * __deprecated bus_to_virt(unsigned long address)
-{
-       void *virt;
-
-       /* This check is a sanity check but also ensures that bus address 0
-          maps to virtual address 0 which is useful to detect null pointers
-          (the NCR driver is much simpler if NULL pointers are preserved).  */
-       address -= __direct_map_base;
-       virt = phys_to_virt(address);
-       return (long)address <= 0 ? NULL : virt;
-}
-#define isa_bus_to_virt bus_to_virt
-
-/*
- * There are different chipsets to interface the Alpha CPUs to the world.
- */
-
-#define IO_CONCAT(a,b) _IO_CONCAT(a,b)
-#define _IO_CONCAT(a,b)        a ## _ ## b
-
-#ifdef CONFIG_ALPHA_GENERIC
-
-/* In a generic kernel, we always go through the machine vector.  */
-
-#define REMAP1(TYPE, NAME, QUAL)                                       \
-static inline TYPE generic_##NAME(QUAL void __iomem *addr)             \
-{                                                                      \
-       return alpha_mv.mv_##NAME(addr);                                \
-}
-
-#define REMAP2(TYPE, NAME, QUAL)                                       \
-static inline void generic_##NAME(TYPE b, QUAL void __iomem *addr)     \
-{                                                                      \
-       alpha_mv.mv_##NAME(b, addr);                                    \
-}
-
-REMAP1(unsigned int, ioread8, /**/)
-REMAP1(unsigned int, ioread16, /**/)
-REMAP1(unsigned int, ioread32, /**/)
-REMAP1(u8, readb, const volatile)
-REMAP1(u16, readw, const volatile)
-REMAP1(u32, readl, const volatile)
-REMAP1(u64, readq, const volatile)
-
-REMAP2(u8, iowrite8, /**/)
-REMAP2(u16, iowrite16, /**/)
-REMAP2(u32, iowrite32, /**/)
-REMAP2(u8, writeb, volatile)
-REMAP2(u16, writew, volatile)
-REMAP2(u32, writel, volatile)
-REMAP2(u64, writeq, volatile)
-
-#undef REMAP1
-#undef REMAP2
-
-extern inline void __iomem *generic_ioportmap(unsigned long a)
-{
-       return alpha_mv.mv_ioportmap(a);
-}
-
-static inline void __iomem *generic_ioremap(unsigned long a, unsigned long s)
-{
-       return alpha_mv.mv_ioremap(a, s);
-}
-
-static inline void generic_iounmap(volatile void __iomem *a)
-{
-       return alpha_mv.mv_iounmap(a);
-}
-
-static inline int generic_is_ioaddr(unsigned long a)
-{
-       return alpha_mv.mv_is_ioaddr(a);
-}
-
-static inline int generic_is_mmio(const volatile void __iomem *a)
-{
-       return alpha_mv.mv_is_mmio(a);
-}
-
-#define __IO_PREFIX            generic
-#define generic_trivial_rw_bw  0
-#define generic_trivial_rw_lq  0
-#define generic_trivial_io_bw  0
-#define generic_trivial_io_lq  0
-#define generic_trivial_iounmap        0
-
-#else
-
-#if defined(CONFIG_ALPHA_APECS)
-# include <asm/core_apecs.h>
-#elif defined(CONFIG_ALPHA_CIA)
-# include <asm/core_cia.h>
-#elif defined(CONFIG_ALPHA_IRONGATE)
-# include <asm/core_irongate.h>
-#elif defined(CONFIG_ALPHA_JENSEN)
-# include <asm/jensen.h>
-#elif defined(CONFIG_ALPHA_LCA)
-# include <asm/core_lca.h>
-#elif defined(CONFIG_ALPHA_MARVEL)
-# include <asm/core_marvel.h>
-#elif defined(CONFIG_ALPHA_MCPCIA)
-# include <asm/core_mcpcia.h>
-#elif defined(CONFIG_ALPHA_POLARIS)
-# include <asm/core_polaris.h>
-#elif defined(CONFIG_ALPHA_T2)
-# include <asm/core_t2.h>
-#elif defined(CONFIG_ALPHA_TSUNAMI)
-# include <asm/core_tsunami.h>
-#elif defined(CONFIG_ALPHA_TITAN)
-# include <asm/core_titan.h>
-#elif defined(CONFIG_ALPHA_WILDFIRE)
-# include <asm/core_wildfire.h>
-#else
-#error "What system is this?"
-#endif
-
-#endif /* GENERIC */
-
-/*
- * We always have external versions of these routines.
- */
-extern u8              inb(unsigned long port);
-extern u16             inw(unsigned long port);
-extern u32             inl(unsigned long port);
-extern void            outb(u8 b, unsigned long port);
-extern void            outw(u16 b, unsigned long port);
-extern void            outl(u32 b, unsigned long port);
-
-extern u8              readb(const volatile void __iomem *addr);
-extern u16             readw(const volatile void __iomem *addr);
-extern u32             readl(const volatile void __iomem *addr);
-extern u64             readq(const volatile void __iomem *addr);
-extern void            writeb(u8 b, volatile void __iomem *addr);
-extern void            writew(u16 b, volatile void __iomem *addr);
-extern void            writel(u32 b, volatile void __iomem *addr);
-extern void            writeq(u64 b, volatile void __iomem *addr);
-
-extern u8              __raw_readb(const volatile void __iomem *addr);
-extern u16             __raw_readw(const volatile void __iomem *addr);
-extern u32             __raw_readl(const volatile void __iomem *addr);
-extern u64             __raw_readq(const volatile void __iomem *addr);
-extern void            __raw_writeb(u8 b, volatile void __iomem *addr);
-extern void            __raw_writew(u16 b, volatile void __iomem *addr);
-extern void            __raw_writel(u32 b, volatile void __iomem *addr);
-extern void            __raw_writeq(u64 b, volatile void __iomem *addr);
-
-/*
- * Mapping from port numbers to __iomem space is pretty easy.
- */
-
-/* These two have to be extern inline because of the extern prototype from
-   <asm-generic/iomap.h>.  It is not legal to mix "extern" and "static" for
-   the same declaration.  */
-extern inline void __iomem *ioport_map(unsigned long port, unsigned int size)
-{
-       return IO_CONCAT(__IO_PREFIX,ioportmap) (port);
-}
-
-extern inline void ioport_unmap(void __iomem *addr)
-{
-}
-
-static inline void __iomem *ioremap(unsigned long port, unsigned long size)
-{
-       return IO_CONCAT(__IO_PREFIX,ioremap) (port, size);
-}
-
-static inline void __iomem *__ioremap(unsigned long port, unsigned long size,
-                                     unsigned long flags)
-{
-       return ioremap(port, size);
-}
-
-static inline void __iomem * ioremap_nocache(unsigned long offset,
-                                            unsigned long size)
-{
-       return ioremap(offset, size);
-} 
-
-static inline void iounmap(volatile void __iomem *addr)
-{
-       IO_CONCAT(__IO_PREFIX,iounmap)(addr);
-}
-
-static inline int __is_ioaddr(unsigned long addr)
-{
-       return IO_CONCAT(__IO_PREFIX,is_ioaddr)(addr);
-}
-#define __is_ioaddr(a)         __is_ioaddr((unsigned long)(a))
-
-static inline int __is_mmio(const volatile void __iomem *addr)
-{
-       return IO_CONCAT(__IO_PREFIX,is_mmio)(addr);
-}
-
-
-/*
- * If the actual I/O bits are sufficiently trivial, then expand inline.
- */
-
-#if IO_CONCAT(__IO_PREFIX,trivial_io_bw)
-extern inline unsigned int ioread8(void __iomem *addr)
-{
-       unsigned int ret = IO_CONCAT(__IO_PREFIX,ioread8)(addr);
-       mb();
-       return ret;
-}
-
-extern inline unsigned int ioread16(void __iomem *addr)
-{
-       unsigned int ret = IO_CONCAT(__IO_PREFIX,ioread16)(addr);
-       mb();
-       return ret;
-}
-
-extern inline void iowrite8(u8 b, void __iomem *addr)
-{
-       IO_CONCAT(__IO_PREFIX,iowrite8)(b, addr);
-       mb();
-}
-
-extern inline void iowrite16(u16 b, void __iomem *addr)
-{
-       IO_CONCAT(__IO_PREFIX,iowrite16)(b, addr);
-       mb();
-}
-
-extern inline u8 inb(unsigned long port)
-{
-       return ioread8(ioport_map(port, 1));
-}
-
-extern inline u16 inw(unsigned long port)
-{
-       return ioread16(ioport_map(port, 2));
-}
-
-extern inline void outb(u8 b, unsigned long port)
-{
-       iowrite8(b, ioport_map(port, 1));
-}
-
-extern inline void outw(u16 b, unsigned long port)
-{
-       iowrite16(b, ioport_map(port, 2));
-}
-#endif
-
-#if IO_CONCAT(__IO_PREFIX,trivial_io_lq)
-extern inline unsigned int ioread32(void __iomem *addr)
-{
-       unsigned int ret = IO_CONCAT(__IO_PREFIX,ioread32)(addr);
-       mb();
-       return ret;
-}
-
-extern inline void iowrite32(u32 b, void __iomem *addr)
-{
-       IO_CONCAT(__IO_PREFIX,iowrite32)(b, addr);
-       mb();
-}
-
-extern inline u32 inl(unsigned long port)
-{
-       return ioread32(ioport_map(port, 4));
-}
-
-extern inline void outl(u32 b, unsigned long port)
-{
-       iowrite32(b, ioport_map(port, 4));
-}
-#endif
-
-#if IO_CONCAT(__IO_PREFIX,trivial_rw_bw) == 1
-extern inline u8 __raw_readb(const volatile void __iomem *addr)
-{
-       return IO_CONCAT(__IO_PREFIX,readb)(addr);
-}
-
-extern inline u16 __raw_readw(const volatile void __iomem *addr)
-{
-       return IO_CONCAT(__IO_PREFIX,readw)(addr);
-}
-
-extern inline void __raw_writeb(u8 b, volatile void __iomem *addr)
-{
-       IO_CONCAT(__IO_PREFIX,writeb)(b, addr);
-}
-
-extern inline void __raw_writew(u16 b, volatile void __iomem *addr)
-{
-       IO_CONCAT(__IO_PREFIX,writew)(b, addr);
-}
-
-extern inline u8 readb(const volatile void __iomem *addr)
-{
-       u8 ret = __raw_readb(addr);
-       mb();
-       return ret;
-}
-
-extern inline u16 readw(const volatile void __iomem *addr)
-{
-       u16 ret = __raw_readw(addr);
-       mb();
-       return ret;
-}
-
-extern inline void writeb(u8 b, volatile void __iomem *addr)
-{
-       __raw_writeb(b, addr);
-       mb();
-}
-
-extern inline void writew(u16 b, volatile void __iomem *addr)
-{
-       __raw_writew(b, addr);
-       mb();
-}
-#endif
-
-#if IO_CONCAT(__IO_PREFIX,trivial_rw_lq) == 1
-extern inline u32 __raw_readl(const volatile void __iomem *addr)
-{
-       return IO_CONCAT(__IO_PREFIX,readl)(addr);
-}
-
-extern inline u64 __raw_readq(const volatile void __iomem *addr)
-{
-       return IO_CONCAT(__IO_PREFIX,readq)(addr);
-}
-
-extern inline void __raw_writel(u32 b, volatile void __iomem *addr)
-{
-       IO_CONCAT(__IO_PREFIX,writel)(b, addr);
-}
-
-extern inline void __raw_writeq(u64 b, volatile void __iomem *addr)
-{
-       IO_CONCAT(__IO_PREFIX,writeq)(b, addr);
-}
-
-extern inline u32 readl(const volatile void __iomem *addr)
-{
-       u32 ret = __raw_readl(addr);
-       mb();
-       return ret;
-}
-
-extern inline u64 readq(const volatile void __iomem *addr)
-{
-       u64 ret = __raw_readq(addr);
-       mb();
-       return ret;
-}
-
-extern inline void writel(u32 b, volatile void __iomem *addr)
-{
-       __raw_writel(b, addr);
-       mb();
-}
-
-extern inline void writeq(u64 b, volatile void __iomem *addr)
-{
-       __raw_writeq(b, addr);
-       mb();
-}
-#endif
-
-#define inb_p          inb
-#define inw_p          inw
-#define inl_p          inl
-#define outb_p         outb
-#define outw_p         outw
-#define outl_p         outl
-#define readb_relaxed(addr) __raw_readb(addr)
-#define readw_relaxed(addr) __raw_readw(addr)
-#define readl_relaxed(addr) __raw_readl(addr)
-#define readq_relaxed(addr) __raw_readq(addr)
-
-#define mmiowb()
-
-/*
- * String version of IO memory access ops:
- */
-extern void memcpy_fromio(void *, const volatile void __iomem *, long);
-extern void memcpy_toio(volatile void __iomem *, const void *, long);
-extern void _memset_c_io(volatile void __iomem *, unsigned long, long);
-
-static inline void memset_io(volatile void __iomem *addr, u8 c, long len)
-{
-       _memset_c_io(addr, 0x0101010101010101UL * c, len);
-}
-
-#define __HAVE_ARCH_MEMSETW_IO
-static inline void memsetw_io(volatile void __iomem *addr, u16 c, long len)
-{
-       _memset_c_io(addr, 0x0001000100010001UL * c, len);
-}
-
-/*
- * String versions of in/out ops:
- */
-extern void insb (unsigned long port, void *dst, unsigned long count);
-extern void insw (unsigned long port, void *dst, unsigned long count);
-extern void insl (unsigned long port, void *dst, unsigned long count);
-extern void outsb (unsigned long port, const void *src, unsigned long count);
-extern void outsw (unsigned long port, const void *src, unsigned long count);
-extern void outsl (unsigned long port, const void *src, unsigned long count);
-
-/*
- * The Alpha Jensen hardware for some rather strange reason puts
- * the RTC clock at 0x170 instead of 0x70. Probably due to some
- * misguided idea about using 0x70 for NMI stuff.
- *
- * These defines will override the defaults when doing RTC queries
- */
-
-#ifdef CONFIG_ALPHA_GENERIC
-# define RTC_PORT(x)   ((x) + alpha_mv.rtc_port)
-#else
-# ifdef CONFIG_ALPHA_JENSEN
-#  define RTC_PORT(x)  (0x170+(x))
-# else
-#  define RTC_PORT(x)  (0x70 + (x))
-# endif
-#endif
-#define RTC_ALWAYS_BCD 0
-
-/*
- * Some mucking forons use if[n]def writeq to check if platform has it.
- * It's a bloody bad idea and we probably want ARCH_HAS_WRITEQ for them
- * to play with; for now just use cpp anti-recursion logics and make sure
- * that damn thing is defined and expands to itself.
- */
-
-#define writeq writeq
-#define readq readq
-
-/*
- * Convert a physical pointer to a virtual kernel pointer for /dev/mem
- * access
- */
-#define xlate_dev_mem_ptr(p)   __va(p)
-
-/*
- * Convert a virtual cached pointer to an uncached pointer
- */
-#define xlate_dev_kmem_ptr(p)  p
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_IO_H */
diff --git a/include/asm-alpha/io_trivial.h b/include/asm-alpha/io_trivial.h
deleted file mode 100644 (file)
index 1c77f10..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Trivial implementations of basic i/o routines.  Assumes that all
-   of the hard work has been done by ioremap and ioportmap, and that
-   access to i/o space is linear.  */
-
-/* This file may be included multiple times.  */
-
-#if IO_CONCAT(__IO_PREFIX,trivial_io_bw)
-__EXTERN_INLINE unsigned int
-IO_CONCAT(__IO_PREFIX,ioread8)(void __iomem *a)
-{
-       return __kernel_ldbu(*(volatile u8 __force *)a);
-}
-
-__EXTERN_INLINE unsigned int
-IO_CONCAT(__IO_PREFIX,ioread16)(void __iomem *a)
-{
-       return __kernel_ldwu(*(volatile u16 __force *)a);
-}
-
-__EXTERN_INLINE void
-IO_CONCAT(__IO_PREFIX,iowrite8)(u8 b, void __iomem *a)
-{
-       __kernel_stb(b, *(volatile u8 __force *)a);
-}
-
-__EXTERN_INLINE void
-IO_CONCAT(__IO_PREFIX,iowrite16)(u16 b, void __iomem *a)
-{
-       __kernel_stw(b, *(volatile u16 __force *)a);
-}
-#endif
-
-#if IO_CONCAT(__IO_PREFIX,trivial_io_lq)
-__EXTERN_INLINE unsigned int
-IO_CONCAT(__IO_PREFIX,ioread32)(void __iomem *a)
-{
-       return *(volatile u32 __force *)a;
-}
-
-__EXTERN_INLINE void
-IO_CONCAT(__IO_PREFIX,iowrite32)(u32 b, void __iomem *a)
-{
-       *(volatile u32 __force *)a = b;
-}
-#endif
-
-#if IO_CONCAT(__IO_PREFIX,trivial_rw_bw) == 1
-__EXTERN_INLINE u8
-IO_CONCAT(__IO_PREFIX,readb)(const volatile void __iomem *a)
-{
-       return __kernel_ldbu(*(const volatile u8 __force *)a);
-}
-
-__EXTERN_INLINE u16
-IO_CONCAT(__IO_PREFIX,readw)(const volatile void __iomem *a)
-{
-       return __kernel_ldwu(*(const volatile u16 __force *)a);
-}
-
-__EXTERN_INLINE void
-IO_CONCAT(__IO_PREFIX,writeb)(u8 b, volatile void __iomem *a)
-{
-       __kernel_stb(b, *(volatile u8 __force *)a);
-}
-
-__EXTERN_INLINE void
-IO_CONCAT(__IO_PREFIX,writew)(u16 b, volatile void __iomem *a)
-{
-       __kernel_stw(b, *(volatile u16 __force *)a);
-}
-#elif IO_CONCAT(__IO_PREFIX,trivial_rw_bw) == 2
-__EXTERN_INLINE u8
-IO_CONCAT(__IO_PREFIX,readb)(const volatile void __iomem *a)
-{
-       void __iomem *addr = (void __iomem *)a;
-       return IO_CONCAT(__IO_PREFIX,ioread8)(addr);
-}
-
-__EXTERN_INLINE u16
-IO_CONCAT(__IO_PREFIX,readw)(const volatile void __iomem *a)
-{
-       void __iomem *addr = (void __iomem *)a;
-       return IO_CONCAT(__IO_PREFIX,ioread16)(addr);
-}
-
-__EXTERN_INLINE void
-IO_CONCAT(__IO_PREFIX,writeb)(u8 b, volatile void __iomem *a)
-{
-       void __iomem *addr = (void __iomem *)a;
-       IO_CONCAT(__IO_PREFIX,iowrite8)(b, addr);
-}
-
-__EXTERN_INLINE void
-IO_CONCAT(__IO_PREFIX,writew)(u16 b, volatile void __iomem *a)
-{
-       void __iomem *addr = (void __iomem *)a;
-       IO_CONCAT(__IO_PREFIX,iowrite16)(b, addr);
-}
-#endif
-
-#if IO_CONCAT(__IO_PREFIX,trivial_rw_lq) == 1
-__EXTERN_INLINE u32
-IO_CONCAT(__IO_PREFIX,readl)(const volatile void __iomem *a)
-{
-       return *(const volatile u32 __force *)a;
-}
-
-__EXTERN_INLINE u64
-IO_CONCAT(__IO_PREFIX,readq)(const volatile void __iomem *a)
-{
-       return *(const volatile u64 __force *)a;
-}
-
-__EXTERN_INLINE void
-IO_CONCAT(__IO_PREFIX,writel)(u32 b, volatile void __iomem *a)
-{
-       *(volatile u32 __force *)a = b;
-}
-
-__EXTERN_INLINE void
-IO_CONCAT(__IO_PREFIX,writeq)(u64 b, volatile void __iomem *a)
-{
-       *(volatile u64 __force *)a = b;
-}
-#endif
-
-#if IO_CONCAT(__IO_PREFIX,trivial_iounmap)
-__EXTERN_INLINE void IO_CONCAT(__IO_PREFIX,iounmap)(volatile void __iomem *a)
-{
-}
-#endif
diff --git a/include/asm-alpha/ioctl.h b/include/asm-alpha/ioctl.h
deleted file mode 100644 (file)
index fc63727..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef _ALPHA_IOCTL_H
-#define _ALPHA_IOCTL_H
-
-/*
- * The original linux ioctl numbering scheme was just a general
- * "anything goes" setup, where more or less random numbers were
- * assigned.  Sorry, I was clueless when I started out on this.
- *
- * On the alpha, we'll try to clean it up a bit, using a more sane
- * ioctl numbering, and also trying to be compatible with OSF/1 in
- * the process. I'd like to clean it up for the i386 as well, but
- * it's so painful recognizing both the new and the old numbers..
- */
-
-#define _IOC_NRBITS    8
-#define _IOC_TYPEBITS  8
-#define _IOC_SIZEBITS  13
-#define _IOC_DIRBITS   3
-
-#define _IOC_NRMASK    ((1 << _IOC_NRBITS)-1)
-#define _IOC_TYPEMASK  ((1 << _IOC_TYPEBITS)-1)
-#define _IOC_SIZEMASK  ((1 << _IOC_SIZEBITS)-1)
-#define _IOC_DIRMASK   ((1 << _IOC_DIRBITS)-1)
-
-#define _IOC_NRSHIFT   0
-#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
-#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
-#define _IOC_DIRSHIFT  (_IOC_SIZESHIFT+_IOC_SIZEBITS)
-
-/*
- * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit.
- * And this turns out useful to catch old ioctl numbers in header
- * files for us.
- */
-#define _IOC_NONE      1U
-#define _IOC_READ      2U
-#define _IOC_WRITE     4U
-
-#define _IOC(dir,type,nr,size)                 \
-       ((unsigned int)                         \
-        (((dir)  << _IOC_DIRSHIFT) |           \
-         ((type) << _IOC_TYPESHIFT) |          \
-         ((nr)   << _IOC_NRSHIFT) |            \
-         ((size) << _IOC_SIZESHIFT)))
-
-/* used to create numbers */
-#define _IO(type,nr)           _IOC(_IOC_NONE,(type),(nr),0)
-#define _IOR(type,nr,size)     _IOC(_IOC_READ,(type),(nr),sizeof(size))
-#define _IOW(type,nr,size)     _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
-#define _IOWR(type,nr,size)    _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
-
-/* used to decode them.. */
-#define _IOC_DIR(nr)           (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
-#define _IOC_TYPE(nr)          (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
-#define _IOC_NR(nr)            (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
-#define _IOC_SIZE(nr)          (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
-
-/* ...and for the drivers/sound files... */
-
-#define IOC_IN         (_IOC_WRITE << _IOC_DIRSHIFT)
-#define IOC_OUT                (_IOC_READ << _IOC_DIRSHIFT)
-#define IOC_INOUT      ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
-#define IOCSIZE_MASK   (_IOC_SIZEMASK << _IOC_SIZESHIFT)
-#define IOCSIZE_SHIFT  (_IOC_SIZESHIFT)
-
-#endif /* _ALPHA_IOCTL_H */
diff --git a/include/asm-alpha/ioctls.h b/include/asm-alpha/ioctls.h
deleted file mode 100644 (file)
index 67bb9f6..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-#ifndef _ASM_ALPHA_IOCTLS_H
-#define _ASM_ALPHA_IOCTLS_H
-
-#include <asm/ioctl.h>
-
-#define FIOCLEX                _IO('f', 1)
-#define FIONCLEX       _IO('f', 2)
-#define FIOASYNC       _IOW('f', 125, int)
-#define FIONBIO                _IOW('f', 126, int)
-#define FIONREAD       _IOR('f', 127, int)
-#define TIOCINQ                FIONREAD
-#define FIOQSIZE       _IOR('f', 128, loff_t)
-
-#define TIOCGETP       _IOR('t', 8, struct sgttyb)
-#define TIOCSETP       _IOW('t', 9, struct sgttyb)
-#define TIOCSETN       _IOW('t', 10, struct sgttyb)    /* TIOCSETP wo flush */
-
-#define TIOCSETC       _IOW('t', 17, struct tchars)
-#define TIOCGETC       _IOR('t', 18, struct tchars)
-#define TCGETS         _IOR('t', 19, struct termios)
-#define TCSETS         _IOW('t', 20, struct termios)
-#define TCSETSW                _IOW('t', 21, struct termios)
-#define TCSETSF                _IOW('t', 22, struct termios)
-
-#define TCGETA         _IOR('t', 23, struct termio)
-#define TCSETA         _IOW('t', 24, struct termio)
-#define TCSETAW                _IOW('t', 25, struct termio)
-#define TCSETAF                _IOW('t', 28, struct termio)
-
-#define TCSBRK         _IO('t', 29)
-#define TCXONC         _IO('t', 30)
-#define TCFLSH         _IO('t', 31)
-
-#define TIOCSWINSZ     _IOW('t', 103, struct winsize)
-#define TIOCGWINSZ     _IOR('t', 104, struct winsize)
-#define        TIOCSTART       _IO('t', 110)           /* start output, like ^Q */
-#define        TIOCSTOP        _IO('t', 111)           /* stop output, like ^S */
-#define TIOCOUTQ        _IOR('t', 115, int)     /* output queue size */
-
-#define TIOCGLTC       _IOR('t', 116, struct ltchars)
-#define TIOCSLTC       _IOW('t', 117, struct ltchars)
-#define TIOCSPGRP      _IOW('t', 118, int)
-#define TIOCGPGRP      _IOR('t', 119, int)
-
-#define TIOCEXCL       0x540C
-#define TIOCNXCL       0x540D
-#define TIOCSCTTY      0x540E
-
-#define TIOCSTI                0x5412
-#define TIOCMGET       0x5415
-#define TIOCMBIS       0x5416
-#define TIOCMBIC       0x5417
-#define TIOCMSET       0x5418
-# define TIOCM_LE      0x001
-# define TIOCM_DTR     0x002
-# define TIOCM_RTS     0x004
-# define TIOCM_ST      0x008
-# define TIOCM_SR      0x010
-# define TIOCM_CTS     0x020
-# define TIOCM_CAR     0x040
-# define TIOCM_RNG     0x080
-# define TIOCM_DSR     0x100
-# define TIOCM_CD      TIOCM_CAR
-# define TIOCM_RI      TIOCM_RNG
-# define TIOCM_OUT1    0x2000
-# define TIOCM_OUT2    0x4000
-# define TIOCM_LOOP    0x8000
-
-#define TIOCGSOFTCAR   0x5419
-#define TIOCSSOFTCAR   0x541A
-#define TIOCLINUX      0x541C
-#define TIOCCONS       0x541D
-#define TIOCGSERIAL    0x541E
-#define TIOCSSERIAL    0x541F
-#define TIOCPKT                0x5420
-# define TIOCPKT_DATA           0
-# define TIOCPKT_FLUSHREAD      1
-# define TIOCPKT_FLUSHWRITE     2
-# define TIOCPKT_STOP           4
-# define TIOCPKT_START          8
-# define TIOCPKT_NOSTOP                16
-# define TIOCPKT_DOSTOP                32
-
-
-#define TIOCNOTTY      0x5422
-#define TIOCSETD       0x5423
-#define TIOCGETD       0x5424
-#define TCSBRKP                0x5425  /* Needed for POSIX tcsendbreak() */
-#define TIOCSBRK       0x5427  /* BSD compatibility */
-#define TIOCCBRK       0x5428  /* BSD compatibility */
-#define TIOCGSID       0x5429  /* Return the session ID of FD */
-#define TIOCGPTN       _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TIOCSPTLCK     _IOW('T',0x31, int)  /* Lock/unlock Pty */
-
-#define TIOCSERCONFIG  0x5453
-#define TIOCSERGWILD   0x5454
-#define TIOCSERSWILD   0x5455
-#define TIOCGLCKTRMIOS 0x5456
-#define TIOCSLCKTRMIOS 0x5457
-#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
-#define TIOCSERGETLSR   0x5459 /* Get line status register */
-  /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-# define TIOCSER_TEMT    0x01  /* Transmitter physically empty */
-#define TIOCSERGETMULTI 0x545A /* Get multiport config  */
-#define TIOCSERSETMULTI 0x545B /* Set multiport config */
-
-#define TIOCMIWAIT     0x545C  /* wait for a change on serial input line(s) */
-#define TIOCGICOUNT    0x545D  /* read serial port inline interrupt counts */
-#define TIOCGHAYESESP  0x545E  /* Get Hayes ESP configuration */
-#define TIOCSHAYESESP  0x545F  /* Set Hayes ESP configuration */
-
-#endif /* _ASM_ALPHA_IOCTLS_H */
diff --git a/include/asm-alpha/ipcbuf.h b/include/asm-alpha/ipcbuf.h
deleted file mode 100644 (file)
index d9c0e1a..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _ALPHA_IPCBUF_H
-#define _ALPHA_IPCBUF_H
-
-/* 
- * The ipc64_perm structure for alpha architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 32-bit seq
- * - 2 miscellaneous 64-bit values
- */
-
-struct ipc64_perm
-{
-       __kernel_key_t  key;
-       __kernel_uid_t  uid;
-       __kernel_gid_t  gid;
-       __kernel_uid_t  cuid;
-       __kernel_gid_t  cgid;
-       __kernel_mode_t mode; 
-       unsigned short  seq;
-       unsigned short  __pad1;
-       unsigned long   __unused1;
-       unsigned long   __unused2;
-};
-
-#endif /* _ALPHA_IPCBUF_H */
diff --git a/include/asm-alpha/irq.h b/include/asm-alpha/irq.h
deleted file mode 100644 (file)
index 0637740..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifndef _ALPHA_IRQ_H
-#define _ALPHA_IRQ_H
-
-/*
- *     linux/include/alpha/irq.h
- *
- *     (C) 1994 Linus Torvalds
- */
-
-#include <linux/linkage.h>
-
-#if   defined(CONFIG_ALPHA_GENERIC)
-
-/* Here NR_IRQS is not exact, but rather an upper bound.  This is used
-   many places throughout the kernel to size static arrays.  That's ok,
-   we'll use alpha_mv.nr_irqs when we want the real thing.  */
-
-/* When LEGACY_START_ADDRESS is selected, we leave out:
-     TITAN
-     WILDFIRE
-     MARVEL
-
-   This helps keep the kernel object size reasonable for the majority
-   of machines.
-*/
-
-# if defined(CONFIG_ALPHA_LEGACY_START_ADDRESS)
-#  define NR_IRQS      (128)           /* max is RAWHIDE/TAKARA */
-# else
-#  define NR_IRQS      (32768 + 16)    /* marvel - 32 pids */
-# endif
-
-#elif defined(CONFIG_ALPHA_CABRIOLET) || \
-      defined(CONFIG_ALPHA_EB66P)     || \
-      defined(CONFIG_ALPHA_EB164)     || \
-      defined(CONFIG_ALPHA_PC164)     || \
-      defined(CONFIG_ALPHA_LX164)
-# define NR_IRQS       35
-
-#elif defined(CONFIG_ALPHA_EB66)      || \
-      defined(CONFIG_ALPHA_EB64P)     || \
-      defined(CONFIG_ALPHA_MIKASA)
-# define NR_IRQS       32
-
-#elif defined(CONFIG_ALPHA_ALCOR)     || \
-      defined(CONFIG_ALPHA_MIATA)     || \
-      defined(CONFIG_ALPHA_RUFFIAN)   || \
-      defined(CONFIG_ALPHA_RX164)     || \
-      defined(CONFIG_ALPHA_NORITAKE)
-# define NR_IRQS       48
-
-#elif defined(CONFIG_ALPHA_SABLE)     || \
-      defined(CONFIG_ALPHA_SX164)
-# define NR_IRQS       40
-
-#elif defined(CONFIG_ALPHA_DP264) || \
-      defined(CONFIG_ALPHA_LYNX)  || \
-      defined(CONFIG_ALPHA_SHARK) || \
-      defined(CONFIG_ALPHA_EIGER)
-# define NR_IRQS       64
-
-#elif defined(CONFIG_ALPHA_TITAN)
-#define NR_IRQS                80
-
-#elif defined(CONFIG_ALPHA_RAWHIDE) || \
-       defined(CONFIG_ALPHA_TAKARA)
-# define NR_IRQS       128
-
-#elif defined(CONFIG_ALPHA_WILDFIRE)
-# define NR_IRQS       2048 /* enuff for 8 QBBs */
-
-#elif defined(CONFIG_ALPHA_MARVEL)
-# define NR_IRQS       (32768 + 16)    /* marvel - 32 pids*/
-
-#else /* everyone else */
-# define NR_IRQS       16
-#endif
-
-static __inline__ int irq_canonicalize(int irq)
-{
-       /*
-        * XXX is this true for all Alpha's?  The old serial driver
-        * did it this way for years without any complaints, so....
-        */
-       return ((irq == 2) ? 9 : irq);
-}
-
-struct pt_regs;
-extern void (*perf_irq)(unsigned long, struct pt_regs *);
-
-#endif /* _ALPHA_IRQ_H */
diff --git a/include/asm-alpha/irq_regs.h b/include/asm-alpha/irq_regs.h
deleted file mode 100644 (file)
index 3dd9c0b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/irq_regs.h>
diff --git a/include/asm-alpha/jensen.h b/include/asm-alpha/jensen.h
deleted file mode 100644 (file)
index 964b06e..0000000
+++ /dev/null
@@ -1,346 +0,0 @@
-#ifndef __ALPHA_JENSEN_H
-#define __ALPHA_JENSEN_H
-
-#include <asm/compiler.h>
-
-/*
- * Defines for the AlphaPC EISA IO and memory address space.
- */
-
-/*
- * NOTE! The memory operations do not set any memory barriers, as it's
- * not needed for cases like a frame buffer that is essentially memory-like.
- * You need to do them by hand if the operations depend on ordering.
- *
- * Similarly, the port IO operations do a "mb" only after a write operation:
- * if an mb is needed before (as in the case of doing memory mapped IO
- * first, and then a port IO operation to the same device), it needs to be
- * done by hand.
- *
- * After the above has bitten me 100 times, I'll give up and just do the
- * mb all the time, but right now I'm hoping this will work out.  Avoiding
- * mb's may potentially be a noticeable speed improvement, but I can't
- * honestly say I've tested it.
- *
- * Handling interrupts that need to do mb's to synchronize to non-interrupts
- * is another fun race area.  Don't do it (because if you do, I'll have to
- * do *everything* with interrupts disabled, ugh).
- */
-
-/*
- * EISA Interrupt Acknowledge address
- */
-#define EISA_INTA              (IDENT_ADDR + 0x100000000UL)
-
-/*
- * FEPROM addresses
- */
-#define EISA_FEPROM0           (IDENT_ADDR + 0x180000000UL)
-#define EISA_FEPROM1           (IDENT_ADDR + 0x1A0000000UL)
-
-/*
- * VL82C106 base address
- */
-#define EISA_VL82C106          (IDENT_ADDR + 0x1C0000000UL)
-
-/*
- * EISA "Host Address Extension" address (bits 25-31 of the EISA address)
- */
-#define EISA_HAE               (IDENT_ADDR + 0x1D0000000UL)
-
-/*
- * "SYSCTL" register address
- */
-#define EISA_SYSCTL            (IDENT_ADDR + 0x1E0000000UL)
-
-/*
- * "spare" register address
- */
-#define EISA_SPARE             (IDENT_ADDR + 0x1F0000000UL)
-
-/*
- * EISA memory address offset
- */
-#define EISA_MEM               (IDENT_ADDR + 0x200000000UL)
-
-/*
- * EISA IO address offset
- */
-#define EISA_IO                        (IDENT_ADDR + 0x300000000UL)
-
-
-#ifdef __KERNEL__
-
-#ifndef __EXTERN_INLINE
-#define __EXTERN_INLINE extern inline
-#define __IO_EXTERN_INLINE
-#endif
-
-/*
- * Handle the "host address register". This needs to be set
- * to the high 7 bits of the EISA address.  This is also needed
- * for EISA IO addresses, which are only 16 bits wide (the
- * hae needs to be set to 0).
- *
- * HAE isn't needed for the local IO operations, though.
- */
-
-#define JENSEN_HAE_ADDRESS     EISA_HAE
-#define JENSEN_HAE_MASK                0x1ffffff
-
-__EXTERN_INLINE void jensen_set_hae(unsigned long addr)
-{
-       /* hae on the Jensen is bits 31:25 shifted right */
-       addr >>= 25;
-       if (addr != alpha_mv.hae_cache)
-               set_hae(addr);
-}
-
-#define vuip   volatile unsigned int *
-
-/*
- * IO functions
- *
- * The "local" functions are those that don't go out to the EISA bus,
- * but instead act on the VL82C106 chip directly.. This is mainly the
- * keyboard, RTC,  printer and first two serial lines..
- *
- * The local stuff makes for some complications, but it seems to be
- * gone in the PCI version. I hope I can get DEC suckered^H^H^H^H^H^H^H^H
- * convinced that I need one of the newer machines.
- */
-
-static inline unsigned int jensen_local_inb(unsigned long addr)
-{
-       return 0xff & *(vuip)((addr << 9) + EISA_VL82C106);
-}
-
-static inline void jensen_local_outb(u8 b, unsigned long addr)
-{
-       *(vuip)((addr << 9) + EISA_VL82C106) = b;
-       mb();
-}
-
-static inline unsigned int jensen_bus_inb(unsigned long addr)
-{
-       long result;
-
-       jensen_set_hae(0);
-       result = *(volatile int *)((addr << 7) + EISA_IO + 0x00);
-       return __kernel_extbl(result, addr & 3);
-}
-
-static inline void jensen_bus_outb(u8 b, unsigned long addr)
-{
-       jensen_set_hae(0);
-       *(vuip)((addr << 7) + EISA_IO + 0x00) = b * 0x01010101;
-       mb();
-}
-
-/*
- * It seems gcc is not very good at optimizing away logical
- * operations that result in operations across inline functions.
- * Which is why this is a macro.
- */
-
-#define jensen_is_local(addr) ( \
-/* keyboard */ (addr == 0x60 || addr == 0x64) || \
-/* RTC */      (addr == 0x170 || addr == 0x171) || \
-/* mb COM2 */  (addr >= 0x2f8 && addr <= 0x2ff) || \
-/* mb LPT1 */  (addr >= 0x3bc && addr <= 0x3be) || \
-/* mb COM2 */  (addr >= 0x3f8 && addr <= 0x3ff))
-
-__EXTERN_INLINE u8 jensen_inb(unsigned long addr)
-{
-       if (jensen_is_local(addr))
-               return jensen_local_inb(addr);
-       else
-               return jensen_bus_inb(addr);
-}
-
-__EXTERN_INLINE void jensen_outb(u8 b, unsigned long addr)
-{
-       if (jensen_is_local(addr))
-               jensen_local_outb(b, addr);
-       else
-               jensen_bus_outb(b, addr);
-}
-
-__EXTERN_INLINE u16 jensen_inw(unsigned long addr)
-{
-       long result;
-
-       jensen_set_hae(0);
-       result = *(volatile int *) ((addr << 7) + EISA_IO + 0x20);
-       result >>= (addr & 3) * 8;
-       return 0xffffUL & result;
-}
-
-__EXTERN_INLINE u32 jensen_inl(unsigned long addr)
-{
-       jensen_set_hae(0);
-       return *(vuip) ((addr << 7) + EISA_IO + 0x60);
-}
-
-__EXTERN_INLINE void jensen_outw(u16 b, unsigned long addr)
-{
-       jensen_set_hae(0);
-       *(vuip) ((addr << 7) + EISA_IO + 0x20) = b * 0x00010001;
-       mb();
-}
-
-__EXTERN_INLINE void jensen_outl(u32 b, unsigned long addr)
-{
-       jensen_set_hae(0);
-       *(vuip) ((addr << 7) + EISA_IO + 0x60) = b;
-       mb();
-}
-
-/*
- * Memory functions.
- */
-
-__EXTERN_INLINE u8 jensen_readb(const volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       long result;
-
-       jensen_set_hae(addr);
-       addr &= JENSEN_HAE_MASK;
-       result = *(volatile int *) ((addr << 7) + EISA_MEM + 0x00);
-       result >>= (addr & 3) * 8;
-       return 0xffUL & result;
-}
-
-__EXTERN_INLINE u16 jensen_readw(const volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       long result;
-
-       jensen_set_hae(addr);
-       addr &= JENSEN_HAE_MASK;
-       result = *(volatile int *) ((addr << 7) + EISA_MEM + 0x20);
-       result >>= (addr & 3) * 8;
-       return 0xffffUL & result;
-}
-
-__EXTERN_INLINE u32 jensen_readl(const volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       jensen_set_hae(addr);
-       addr &= JENSEN_HAE_MASK;
-       return *(vuip) ((addr << 7) + EISA_MEM + 0x60);
-}
-
-__EXTERN_INLINE u64 jensen_readq(const volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       unsigned long r0, r1;
-
-       jensen_set_hae(addr);
-       addr &= JENSEN_HAE_MASK;
-       addr = (addr << 7) + EISA_MEM + 0x60;
-       r0 = *(vuip) (addr);
-       r1 = *(vuip) (addr + (4 << 7));
-       return r1 << 32 | r0;
-}
-
-__EXTERN_INLINE void jensen_writeb(u8 b, volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       jensen_set_hae(addr);
-       addr &= JENSEN_HAE_MASK;
-       *(vuip) ((addr << 7) + EISA_MEM + 0x00) = b * 0x01010101;
-}
-
-__EXTERN_INLINE void jensen_writew(u16 b, volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       jensen_set_hae(addr);
-       addr &= JENSEN_HAE_MASK;
-       *(vuip) ((addr << 7) + EISA_MEM + 0x20) = b * 0x00010001;
-}
-
-__EXTERN_INLINE void jensen_writel(u32 b, volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       jensen_set_hae(addr);
-       addr &= JENSEN_HAE_MASK;
-       *(vuip) ((addr << 7) + EISA_MEM + 0x60) = b;
-}
-
-__EXTERN_INLINE void jensen_writeq(u64 b, volatile void __iomem *xaddr)
-{
-       unsigned long addr = (unsigned long) xaddr;
-       jensen_set_hae(addr);
-       addr &= JENSEN_HAE_MASK;
-       addr = (addr << 7) + EISA_MEM + 0x60;
-       *(vuip) (addr) = b;
-       *(vuip) (addr + (4 << 7)) = b >> 32;
-}
-
-__EXTERN_INLINE void __iomem *jensen_ioportmap(unsigned long addr)
-{
-       return (void __iomem *)addr;
-}
-
-__EXTERN_INLINE void __iomem *jensen_ioremap(unsigned long addr,
-                                            unsigned long size)
-{
-       return (void __iomem *)(addr + 0x100000000ul);
-}
-
-__EXTERN_INLINE int jensen_is_ioaddr(unsigned long addr)
-{
-       return (long)addr >= 0;
-}
-
-__EXTERN_INLINE int jensen_is_mmio(const volatile void __iomem *addr)
-{
-       return (unsigned long)addr >= 0x100000000ul;
-}
-
-/* New-style ioread interface.  All the routines are so ugly for Jensen
-   that it doesn't make sense to merge them.  */
-
-#define IOPORT(OS, NS)                                                 \
-__EXTERN_INLINE unsigned int jensen_ioread##NS(void __iomem *xaddr)    \
-{                                                                      \
-       if (jensen_is_mmio(xaddr))                                      \
-               return jensen_read##OS(xaddr - 0x100000000ul);          \
-       else                                                            \
-               return jensen_in##OS((unsigned long)xaddr);             \
-}                                                                      \
-__EXTERN_INLINE void jensen_iowrite##NS(u##NS b, void __iomem *xaddr)  \
-{                                                                      \
-       if (jensen_is_mmio(xaddr))                                      \
-               jensen_write##OS(b, xaddr - 0x100000000ul);             \
-       else                                                            \
-               jensen_out##OS(b, (unsigned long)xaddr);                \
-}
-
-IOPORT(b, 8)
-IOPORT(w, 16)
-IOPORT(l, 32)
-
-#undef IOPORT
-
-#undef vuip
-
-#undef __IO_PREFIX
-#define __IO_PREFIX            jensen
-#define jensen_trivial_rw_bw   0
-#define jensen_trivial_rw_lq   0
-#define jensen_trivial_io_bw   0
-#define jensen_trivial_io_lq   0
-#define jensen_trivial_iounmap 1
-#include <asm/io_trivial.h>
-
-#ifdef __IO_EXTERN_INLINE
-#undef __EXTERN_INLINE
-#undef __IO_EXTERN_INLINE
-#endif
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_JENSEN_H */
diff --git a/include/asm-alpha/kdebug.h b/include/asm-alpha/kdebug.h
deleted file mode 100644 (file)
index 6ece1b0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/kdebug.h>
diff --git a/include/asm-alpha/kmap_types.h b/include/asm-alpha/kmap_types.h
deleted file mode 100644 (file)
index 3e6735a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef _ASM_KMAP_TYPES_H
-#define _ASM_KMAP_TYPES_H
-
-/* Dummy header just to define km_type. */
-
-
-#ifdef CONFIG_DEBUG_HIGHMEM
-# define D(n) __KM_FENCE_##n ,
-#else
-# define D(n)
-#endif
-
-enum km_type {
-D(0)   KM_BOUNCE_READ,
-D(1)   KM_SKB_SUNRPC_DATA,
-D(2)   KM_SKB_DATA_SOFTIRQ,
-D(3)   KM_USER0,
-D(4)   KM_USER1,
-D(5)   KM_BIO_SRC_IRQ,
-D(6)   KM_BIO_DST_IRQ,
-D(7)   KM_PTE0,
-D(8)   KM_PTE1,
-D(9)   KM_IRQ0,
-D(10)  KM_IRQ1,
-D(11)  KM_SOFTIRQ0,
-D(12)  KM_SOFTIRQ1,
-D(13)  KM_TYPE_NR
-};
-
-#undef D
-
-#endif
diff --git a/include/asm-alpha/linkage.h b/include/asm-alpha/linkage.h
deleted file mode 100644 (file)
index 291c2d0..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ASM_LINKAGE_H
-#define __ASM_LINKAGE_H
-
-/* Nothing to see here... */
-
-#endif
diff --git a/include/asm-alpha/local.h b/include/asm-alpha/local.h
deleted file mode 100644 (file)
index 6ad3ea6..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-#ifndef _ALPHA_LOCAL_H
-#define _ALPHA_LOCAL_H
-
-#include <linux/percpu.h>
-#include <asm/atomic.h>
-
-typedef struct
-{
-       atomic_long_t a;
-} local_t;
-
-#define LOCAL_INIT(i)  { ATOMIC_LONG_INIT(i) }
-#define local_read(l)  atomic_long_read(&(l)->a)
-#define local_set(l,i) atomic_long_set(&(l)->a, (i))
-#define local_inc(l)   atomic_long_inc(&(l)->a)
-#define local_dec(l)   atomic_long_dec(&(l)->a)
-#define local_add(i,l) atomic_long_add((i),(&(l)->a))
-#define local_sub(i,l) atomic_long_sub((i),(&(l)->a))
-
-static __inline__ long local_add_return(long i, local_t * l)
-{
-       long temp, result;
-       __asm__ __volatile__(
-       "1:     ldq_l %0,%1\n"
-       "       addq %0,%3,%2\n"
-       "       addq %0,%3,%0\n"
-       "       stq_c %0,%1\n"
-       "       beq %0,2f\n"
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (l->a.counter), "=&r" (result)
-       :"Ir" (i), "m" (l->a.counter) : "memory");
-       return result;
-}
-
-static __inline__ long local_sub_return(long i, local_t * l)
-{
-       long temp, result;
-       __asm__ __volatile__(
-       "1:     ldq_l %0,%1\n"
-       "       subq %0,%3,%2\n"
-       "       subq %0,%3,%0\n"
-       "       stq_c %0,%1\n"
-       "       beq %0,2f\n"
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (l->a.counter), "=&r" (result)
-       :"Ir" (i), "m" (l->a.counter) : "memory");
-       return result;
-}
-
-#define local_cmpxchg(l, o, n) \
-       (cmpxchg_local(&((l)->a.counter), (o), (n)))
-#define local_xchg(l, n) (xchg_local(&((l)->a.counter), (n)))
-
-/**
- * local_add_unless - add unless the number is a given value
- * @l: pointer of type local_t
- * @a: the amount to add to l...
- * @u: ...unless l is equal to u.
- *
- * Atomically adds @a to @l, so long as it was not @u.
- * Returns non-zero if @l was not @u, and zero otherwise.
- */
-#define local_add_unless(l, a, u)                              \
-({                                                             \
-       long c, old;                                            \
-       c = local_read(l);                                      \
-       for (;;) {                                              \
-               if (unlikely(c == (u)))                         \
-                       break;                                  \
-               old = local_cmpxchg((l), c, c + (a));   \
-               if (likely(old == c))                           \
-                       break;                                  \
-               c = old;                                        \
-       }                                                       \
-       c != (u);                                               \
-})
-#define local_inc_not_zero(l) local_add_unless((l), 1, 0)
-
-#define local_add_negative(a, l) (local_add_return((a), (l)) < 0)
-
-#define local_dec_return(l) local_sub_return(1,(l))
-
-#define local_inc_return(l) local_add_return(1,(l))
-
-#define local_sub_and_test(i,l) (local_sub_return((i), (l)) == 0)
-
-#define local_inc_and_test(l) (local_add_return(1, (l)) == 0)
-
-#define local_dec_and_test(l) (local_sub_return(1, (l)) == 0)
-
-/* Verify if faster than atomic ops */
-#define __local_inc(l)         ((l)->a.counter++)
-#define __local_dec(l)         ((l)->a.counter++)
-#define __local_add(i,l)       ((l)->a.counter+=(i))
-#define __local_sub(i,l)       ((l)->a.counter-=(i))
-
-/* Use these for per-cpu local_t variables: on some archs they are
- * much more efficient than these naive implementations.  Note they take
- * a variable, not an address.
- */
-#define cpu_local_read(l)      local_read(&__get_cpu_var(l))
-#define cpu_local_set(l, i)    local_set(&__get_cpu_var(l), (i))
-
-#define cpu_local_inc(l)       local_inc(&__get_cpu_var(l))
-#define cpu_local_dec(l)       local_dec(&__get_cpu_var(l))
-#define cpu_local_add(i, l)    local_add((i), &__get_cpu_var(l))
-#define cpu_local_sub(i, l)    local_sub((i), &__get_cpu_var(l))
-
-#define __cpu_local_inc(l)     __local_inc(&__get_cpu_var(l))
-#define __cpu_local_dec(l)     __local_dec(&__get_cpu_var(l))
-#define __cpu_local_add(i, l)  __local_add((i), &__get_cpu_var(l))
-#define __cpu_local_sub(i, l)  __local_sub((i), &__get_cpu_var(l))
-
-#endif /* _ALPHA_LOCAL_H */
diff --git a/include/asm-alpha/machvec.h b/include/asm-alpha/machvec.h
deleted file mode 100644 (file)
index a86c083..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-#ifndef __ALPHA_MACHVEC_H
-#define __ALPHA_MACHVEC_H 1
-
-#include <linux/types.h>
-
-/*
- *     This file gets pulled in by asm/io.h from user space. We don't
- *     want most of this escaping.
- */
-#ifdef __KERNEL__
-
-/* The following structure vectors all of the I/O and IRQ manipulation
-   from the generic kernel to the hardware specific backend.  */
-
-struct task_struct;
-struct mm_struct;
-struct vm_area_struct;
-struct linux_hose_info;
-struct pci_dev;
-struct pci_ops;
-struct pci_controller;
-struct _alpha_agp_info;
-
-struct alpha_machine_vector
-{
-       /* This "belongs" down below with the rest of the runtime
-          variables, but it is convenient for entry.S if these 
-          two slots are at the beginning of the struct.  */
-       unsigned long hae_cache;
-       unsigned long *hae_register;
-
-       int nr_irqs;
-       int rtc_port;
-       unsigned int max_asn;
-       unsigned long max_isa_dma_address;
-       unsigned long irq_probe_mask;
-       unsigned long iack_sc;
-       unsigned long min_io_address;
-       unsigned long min_mem_address;
-       unsigned long pci_dac_offset;
-
-       void (*mv_pci_tbi)(struct pci_controller *hose,
-                          dma_addr_t start, dma_addr_t end);
-
-       unsigned int (*mv_ioread8)(void __iomem *);
-       unsigned int (*mv_ioread16)(void __iomem *);
-       unsigned int (*mv_ioread32)(void __iomem *);
-
-       void (*mv_iowrite8)(u8, void __iomem *);
-       void (*mv_iowrite16)(u16, void __iomem *);
-       void (*mv_iowrite32)(u32, void __iomem *);
-
-       u8 (*mv_readb)(const volatile void __iomem *);
-       u16 (*mv_readw)(const volatile void __iomem *);
-       u32 (*mv_readl)(const volatile void __iomem *);
-       u64 (*mv_readq)(const volatile void __iomem *);
-
-       void (*mv_writeb)(u8, volatile void __iomem *);
-       void (*mv_writew)(u16, volatile void __iomem *);
-       void (*mv_writel)(u32, volatile void __iomem *);
-       void (*mv_writeq)(u64, volatile void __iomem *);
-
-       void __iomem *(*mv_ioportmap)(unsigned long);
-       void __iomem *(*mv_ioremap)(unsigned long, unsigned long);
-       void (*mv_iounmap)(volatile void __iomem *);
-       int (*mv_is_ioaddr)(unsigned long);
-       int (*mv_is_mmio)(const volatile void __iomem *);
-
-       void (*mv_switch_mm)(struct mm_struct *, struct mm_struct *,
-                            struct task_struct *);
-       void (*mv_activate_mm)(struct mm_struct *, struct mm_struct *);
-
-       void (*mv_flush_tlb_current)(struct mm_struct *);
-       void (*mv_flush_tlb_current_page)(struct mm_struct * mm,
-                                         struct vm_area_struct *vma,
-                                         unsigned long addr);
-
-       void (*update_irq_hw)(unsigned long, unsigned long, int);
-       void (*ack_irq)(unsigned long);
-       void (*device_interrupt)(unsigned long vector);
-       void (*machine_check)(u64 vector, u64 la);
-
-       void (*smp_callin)(void);
-       void (*init_arch)(void);
-       void (*init_irq)(void);
-       void (*init_rtc)(void);
-       void (*init_pci)(void);
-       void (*kill_arch)(int);
-
-       u8 (*pci_swizzle)(struct pci_dev *, u8 *);
-       int (*pci_map_irq)(struct pci_dev *, u8, u8);
-       struct pci_ops *pci_ops;
-
-       struct _alpha_agp_info *(*agp_info)(void);
-
-       const char *vector_name;
-
-       /* NUMA information */
-       int (*pa_to_nid)(unsigned long);
-       int (*cpuid_to_nid)(int);
-       unsigned long (*node_mem_start)(int);
-       unsigned long (*node_mem_size)(int);
-
-       /* System specific parameters.  */
-       union {
-           struct {
-               unsigned long gru_int_req_bits;
-           } cia;
-
-           struct {
-               unsigned long gamma_bias;
-           } t2;
-
-           struct {
-               unsigned int route_tab;
-           } sio;
-       } sys;
-};
-
-extern struct alpha_machine_vector alpha_mv;
-
-#ifdef CONFIG_ALPHA_GENERIC
-extern int alpha_using_srm;
-#else
-#ifdef CONFIG_ALPHA_SRM
-#define alpha_using_srm 1
-#else
-#define alpha_using_srm 0
-#endif
-#endif /* GENERIC */
-
-#endif
-#endif /* __ALPHA_MACHVEC_H */
diff --git a/include/asm-alpha/mc146818rtc.h b/include/asm-alpha/mc146818rtc.h
deleted file mode 100644 (file)
index 097703f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Machine dependent access functions for RTC registers.
- */
-#ifndef __ASM_ALPHA_MC146818RTC_H
-#define __ASM_ALPHA_MC146818RTC_H
-
-#include <asm/io.h>
-
-#ifndef RTC_PORT
-#define RTC_PORT(x)    (0x70 + (x))
-#define RTC_ALWAYS_BCD 1       /* RTC operates in binary mode */
-#endif
-
-/*
- * The yet supported machines all access the RTC index register via
- * an ISA port access but the way to access the date register differs ...
- */
-#define CMOS_READ(addr) ({ \
-outb_p((addr),RTC_PORT(0)); \
-inb_p(RTC_PORT(1)); \
-})
-#define CMOS_WRITE(val, addr) ({ \
-outb_p((addr),RTC_PORT(0)); \
-outb_p((val),RTC_PORT(1)); \
-})
-
-#endif /* __ASM_ALPHA_MC146818RTC_H */
diff --git a/include/asm-alpha/md.h b/include/asm-alpha/md.h
deleted file mode 100644 (file)
index 6c9b822..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* $Id: md.h,v 1.1 1997/12/15 15:11:48 jj Exp $
- * md.h: High speed xor_block operation for RAID4/5 
- *
- */
-#ifndef __ASM_MD_H
-#define __ASM_MD_H
-
-/* #define HAVE_ARCH_XORBLOCK */
-
-#define MD_XORBLOCK_ALIGNMENT  sizeof(long)
-
-#endif /* __ASM_MD_H */
diff --git a/include/asm-alpha/mman.h b/include/asm-alpha/mman.h
deleted file mode 100644 (file)
index 90d7c35..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef __ALPHA_MMAN_H__
-#define __ALPHA_MMAN_H__
-
-#define PROT_READ      0x1             /* page can be read */
-#define PROT_WRITE     0x2             /* page can be written */
-#define PROT_EXEC      0x4             /* page can be executed */
-#define PROT_SEM       0x8             /* page may be used for atomic ops */
-#define PROT_NONE      0x0             /* page can not be accessed */
-#define PROT_GROWSDOWN 0x01000000      /* mprotect flag: extend change to start of growsdown vma */
-#define PROT_GROWSUP   0x02000000      /* mprotect flag: extend change to end of growsup vma */
-
-#define MAP_SHARED     0x01            /* Share changes */
-#define MAP_PRIVATE    0x02            /* Changes are private */
-#define MAP_TYPE       0x0f            /* Mask for type of mapping (OSF/1 is _wrong_) */
-#define MAP_FIXED      0x100           /* Interpret addr exactly */
-#define MAP_ANONYMOUS  0x10            /* don't use a file */
-
-/* not used by linux, but here to make sure we don't clash with OSF/1 defines */
-#define _MAP_HASSEMAPHORE 0x0200
-#define _MAP_INHERIT   0x0400
-#define _MAP_UNALIGNED 0x0800
-
-/* These are linux-specific */
-#define MAP_GROWSDOWN  0x01000         /* stack-like segment */
-#define MAP_DENYWRITE  0x02000         /* ETXTBSY */
-#define MAP_EXECUTABLE 0x04000         /* mark it as an executable */
-#define MAP_LOCKED     0x08000         /* lock the mapping */
-#define MAP_NORESERVE  0x10000         /* don't check for reservations */
-#define MAP_POPULATE   0x20000         /* populate (prefault) pagetables */
-#define MAP_NONBLOCK   0x40000         /* do not block on IO */
-
-#define MS_ASYNC       1               /* sync memory asynchronously */
-#define MS_SYNC                2               /* synchronous memory sync */
-#define MS_INVALIDATE  4               /* invalidate the caches */
-
-#define MCL_CURRENT     8192           /* lock all currently mapped pages */
-#define MCL_FUTURE     16384           /* lock all additions to address space */
-
-#define MADV_NORMAL    0               /* no further special treatment */
-#define MADV_RANDOM    1               /* expect random page references */
-#define MADV_SEQUENTIAL        2               /* expect sequential page references */
-#define MADV_WILLNEED  3               /* will need these pages */
-#define        MADV_SPACEAVAIL 5               /* ensure resources are available */
-#define MADV_DONTNEED  6               /* don't need these pages */
-
-/* common/generic parameters */
-#define MADV_REMOVE    9               /* remove these pages & resources */
-#define MADV_DONTFORK  10              /* don't inherit across fork */
-#define MADV_DOFORK    11              /* do inherit across fork */
-
-/* compatibility flags */
-#define MAP_FILE       0
-
-#endif /* __ALPHA_MMAN_H__ */
diff --git a/include/asm-alpha/mmu.h b/include/asm-alpha/mmu.h
deleted file mode 100644 (file)
index 3dc1277..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __ALPHA_MMU_H
-#define __ALPHA_MMU_H
-
-/* The alpha MMU context is one "unsigned long" bitmap per CPU */
-typedef unsigned long mm_context_t[NR_CPUS];
-
-#endif
diff --git a/include/asm-alpha/mmu_context.h b/include/asm-alpha/mmu_context.h
deleted file mode 100644 (file)
index 86c08a0..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-#ifndef __ALPHA_MMU_CONTEXT_H
-#define __ALPHA_MMU_CONTEXT_H
-
-/*
- * get a new mmu context..
- *
- * Copyright (C) 1996, Linus Torvalds
- */
-
-#include <asm/system.h>
-#include <asm/machvec.h>
-#include <asm/compiler.h>
-#include <asm-generic/mm_hooks.h>
-
-/*
- * Force a context reload. This is needed when we change the page
- * table pointer or when we update the ASN of the current process.
- */
-
-/* Don't get into trouble with dueling __EXTERN_INLINEs.  */
-#ifndef __EXTERN_INLINE
-#include <asm/io.h>
-#endif
-
-
-static inline unsigned long
-__reload_thread(struct pcb_struct *pcb)
-{
-       register unsigned long a0 __asm__("$16");
-       register unsigned long v0 __asm__("$0");
-
-       a0 = virt_to_phys(pcb);
-       __asm__ __volatile__(
-               "call_pal %2 #__reload_thread"
-               : "=r"(v0), "=r"(a0)
-               : "i"(PAL_swpctx), "r"(a0)
-               : "$1", "$22", "$23", "$24", "$25");
-
-       return v0;
-}
-
-
-/*
- * The maximum ASN's the processor supports.  On the EV4 this is 63
- * but the PAL-code doesn't actually use this information.  On the
- * EV5 this is 127, and EV6 has 255.
- *
- * On the EV4, the ASNs are more-or-less useless anyway, as they are
- * only used as an icache tag, not for TB entries.  On the EV5 and EV6,
- * ASN's also validate the TB entries, and thus make a lot more sense.
- *
- * The EV4 ASN's don't even match the architecture manual, ugh.  And
- * I quote: "If a processor implements address space numbers (ASNs),
- * and the old PTE has the Address Space Match (ASM) bit clear (ASNs
- * in use) and the Valid bit set, then entries can also effectively be
- * made coherent by assigning a new, unused ASN to the currently
- * running process and not reusing the previous ASN before calling the
- * appropriate PALcode routine to invalidate the translation buffer (TB)". 
- *
- * In short, the EV4 has a "kind of" ASN capability, but it doesn't actually
- * work correctly and can thus not be used (explaining the lack of PAL-code
- * support).
- */
-#define EV4_MAX_ASN 63
-#define EV5_MAX_ASN 127
-#define EV6_MAX_ASN 255
-
-#ifdef CONFIG_ALPHA_GENERIC
-# define MAX_ASN       (alpha_mv.max_asn)
-#else
-# ifdef CONFIG_ALPHA_EV4
-#  define MAX_ASN      EV4_MAX_ASN
-# elif defined(CONFIG_ALPHA_EV5)
-#  define MAX_ASN      EV5_MAX_ASN
-# else
-#  define MAX_ASN      EV6_MAX_ASN
-# endif
-#endif
-
-/*
- * cpu_last_asn(processor):
- * 63                                            0
- * +-------------+----------------+--------------+
- * | asn version | this processor | hardware asn |
- * +-------------+----------------+--------------+
- */
-
-#include <asm/smp.h>
-#ifdef CONFIG_SMP
-#define cpu_last_asn(cpuid)    (cpu_data[cpuid].last_asn)
-#else
-extern unsigned long last_asn;
-#define cpu_last_asn(cpuid)    last_asn
-#endif /* CONFIG_SMP */
-
-#define WIDTH_HARDWARE_ASN     8
-#define ASN_FIRST_VERSION (1UL << WIDTH_HARDWARE_ASN)
-#define HARDWARE_ASN_MASK ((1UL << WIDTH_HARDWARE_ASN) - 1)
-
-/*
- * NOTE! The way this is set up, the high bits of the "asn_cache" (and
- * the "mm->context") are the ASN _version_ code. A version of 0 is
- * always considered invalid, so to invalidate another process you only
- * need to do "p->mm->context = 0".
- *
- * If we need more ASN's than the processor has, we invalidate the old
- * user TLB's (tbiap()) and start a new ASN version. That will automatically
- * force a new asn for any other processes the next time they want to
- * run.
- */
-
-#ifndef __EXTERN_INLINE
-#define __EXTERN_INLINE extern inline
-#define __MMU_EXTERN_INLINE
-#endif
-
-extern inline unsigned long
-__get_new_mm_context(struct mm_struct *mm, long cpu)
-{
-       unsigned long asn = cpu_last_asn(cpu);
-       unsigned long next = asn + 1;
-
-       if ((asn & HARDWARE_ASN_MASK) >= MAX_ASN) {
-               tbiap();
-               imb();
-               next = (asn & ~HARDWARE_ASN_MASK) + ASN_FIRST_VERSION;
-       }
-       cpu_last_asn(cpu) = next;
-       return next;
-}
-
-__EXTERN_INLINE void
-ev5_switch_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm,
-             struct task_struct *next)
-{
-       /* Check if our ASN is of an older version, and thus invalid. */
-       unsigned long asn;
-       unsigned long mmc;
-       long cpu = smp_processor_id();
-
-#ifdef CONFIG_SMP
-       cpu_data[cpu].asn_lock = 1;
-       barrier();
-#endif
-       asn = cpu_last_asn(cpu);
-       mmc = next_mm->context[cpu];
-       if ((mmc ^ asn) & ~HARDWARE_ASN_MASK) {
-               mmc = __get_new_mm_context(next_mm, cpu);
-               next_mm->context[cpu] = mmc;
-       }
-#ifdef CONFIG_SMP
-       else
-               cpu_data[cpu].need_new_asn = 1;
-#endif
-
-       /* Always update the PCB ASN.  Another thread may have allocated
-          a new mm->context (via flush_tlb_mm) without the ASN serial
-          number wrapping.  We have no way to detect when this is needed.  */
-       task_thread_info(next)->pcb.asn = mmc & HARDWARE_ASN_MASK;
-}
-
-__EXTERN_INLINE void
-ev4_switch_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm,
-             struct task_struct *next)
-{
-       /* As described, ASN's are broken for TLB usage.  But we can
-          optimize for switching between threads -- if the mm is
-          unchanged from current we needn't flush.  */
-       /* ??? May not be needed because EV4 PALcode recognizes that
-          ASN's are broken and does a tbiap itself on swpctx, under
-          the "Must set ASN or flush" rule.  At least this is true
-          for a 1992 SRM, reports Joseph Martin (jmartin@hlo.dec.com).
-          I'm going to leave this here anyway, just to Be Sure.  -- r~  */
-       if (prev_mm != next_mm)
-               tbiap();
-
-       /* Do continue to allocate ASNs, because we can still use them
-          to avoid flushing the icache.  */
-       ev5_switch_mm(prev_mm, next_mm, next);
-}
-
-extern void __load_new_mm_context(struct mm_struct *);
-
-#ifdef CONFIG_SMP
-#define check_mmu_context()                                    \
-do {                                                           \
-       int cpu = smp_processor_id();                           \
-       cpu_data[cpu].asn_lock = 0;                             \
-       barrier();                                              \
-       if (cpu_data[cpu].need_new_asn) {                       \
-               struct mm_struct * mm = current->active_mm;     \
-               cpu_data[cpu].need_new_asn = 0;                 \
-               if (!mm->context[cpu])                  \
-                       __load_new_mm_context(mm);              \
-       }                                                       \
-} while(0)
-#else
-#define check_mmu_context()  do { } while(0)
-#endif
-
-__EXTERN_INLINE void
-ev5_activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm)
-{
-       __load_new_mm_context(next_mm);
-}
-
-__EXTERN_INLINE void
-ev4_activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm)
-{
-       __load_new_mm_context(next_mm);
-       tbiap();
-}
-
-#define deactivate_mm(tsk,mm)  do { } while (0)
-
-#ifdef CONFIG_ALPHA_GENERIC
-# define switch_mm(a,b,c)      alpha_mv.mv_switch_mm((a),(b),(c))
-# define activate_mm(x,y)      alpha_mv.mv_activate_mm((x),(y))
-#else
-# ifdef CONFIG_ALPHA_EV4
-#  define switch_mm(a,b,c)     ev4_switch_mm((a),(b),(c))
-#  define activate_mm(x,y)     ev4_activate_mm((x),(y))
-# else
-#  define switch_mm(a,b,c)     ev5_switch_mm((a),(b),(c))
-#  define activate_mm(x,y)     ev5_activate_mm((x),(y))
-# endif
-#endif
-
-static inline int
-init_new_context(struct task_struct *tsk, struct mm_struct *mm)
-{
-       int i;
-
-       for_each_online_cpu(i)
-               mm->context[i] = 0;
-       if (tsk != current)
-               task_thread_info(tsk)->pcb.ptbr
-                 = ((unsigned long)mm->pgd - IDENT_ADDR) >> PAGE_SHIFT;
-       return 0;
-}
-
-extern inline void
-destroy_context(struct mm_struct *mm)
-{
-       /* Nothing to do.  */
-}
-
-static inline void
-enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
-{
-       task_thread_info(tsk)->pcb.ptbr
-         = ((unsigned long)mm->pgd - IDENT_ADDR) >> PAGE_SHIFT;
-}
-
-#ifdef __MMU_EXTERN_INLINE
-#undef __EXTERN_INLINE
-#undef __MMU_EXTERN_INLINE
-#endif
-
-#endif /* __ALPHA_MMU_CONTEXT_H */
diff --git a/include/asm-alpha/mmzone.h b/include/asm-alpha/mmzone.h
deleted file mode 100644 (file)
index 8af56ce..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Written by Kanoj Sarcar (kanoj@sgi.com) Aug 99
- * Adapted for the alpha wildfire architecture Jan 2001.
- */
-#ifndef _ASM_MMZONE_H_
-#define _ASM_MMZONE_H_
-
-#include <asm/smp.h>
-
-struct bootmem_data_t; /* stupid forward decl. */
-
-/*
- * Following are macros that are specific to this numa platform.
- */
-
-extern pg_data_t node_data[];
-
-#define alpha_pa_to_nid(pa)            \
-        (alpha_mv.pa_to_nid            \
-        ? alpha_mv.pa_to_nid(pa)       \
-        : (0))
-#define node_mem_start(nid)            \
-        (alpha_mv.node_mem_start       \
-        ? alpha_mv.node_mem_start(nid) \
-        : (0UL))
-#define node_mem_size(nid)             \
-        (alpha_mv.node_mem_size        \
-        ? alpha_mv.node_mem_size(nid)  \
-        : ((nid) ? (0UL) : (~0UL)))
-
-#define pa_to_nid(pa)          alpha_pa_to_nid(pa)
-#define NODE_DATA(nid)         (&node_data[(nid)])
-
-#define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn)
-
-#if 1
-#define PLAT_NODE_DATA_LOCALNR(p, n)   \
-       (((p) >> PAGE_SHIFT) - PLAT_NODE_DATA(n)->gendata.node_start_pfn)
-#else
-static inline unsigned long
-PLAT_NODE_DATA_LOCALNR(unsigned long p, int n)
-{
-       unsigned long temp;
-       temp = p >> PAGE_SHIFT;
-       return temp - PLAT_NODE_DATA(n)->gendata.node_start_pfn;
-}
-#endif
-
-#ifdef CONFIG_DISCONTIGMEM
-
-/*
- * Following are macros that each numa implementation must define.
- */
-
-/*
- * Given a kernel address, find the home node of the underlying memory.
- */
-#define kvaddr_to_nid(kaddr)   pa_to_nid(__pa(kaddr))
-#define node_start_pfn(nid)    (NODE_DATA(nid)->node_start_pfn)
-
-/*
- * Given a kaddr, LOCAL_BASE_ADDR finds the owning node of the memory
- * and returns the kaddr corresponding to first physical page in the
- * node's mem_map.
- */
-#define LOCAL_BASE_ADDR(kaddr)                                           \
-    ((unsigned long)__va(NODE_DATA(kvaddr_to_nid(kaddr))->node_start_pfn  \
-                        << PAGE_SHIFT))
-
-/* XXX: FIXME -- wli */
-#define kern_addr_valid(kaddr) (0)
-
-#define virt_to_page(kaddr)    pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
-
-#define VALID_PAGE(page)       (((page) - mem_map) < max_mapnr)
-
-#define pmd_page(pmd)          (pfn_to_page(pmd_val(pmd) >> 32))
-#define pgd_page(pgd)          (pfn_to_page(pgd_val(pgd) >> 32))
-#define pte_pfn(pte)           (pte_val(pte) >> 32)
-
-#define mk_pte(page, pgprot)                                                \
-({                                                                          \
-       pte_t pte;                                                           \
-       unsigned long pfn;                                                   \
-                                                                            \
-       pfn = page_to_pfn(page) << 32; \
-       pte_val(pte) = pfn | pgprot_val(pgprot);                             \
-                                                                            \
-       pte;                                                                 \
-})
-
-#define pte_page(x)                                                    \
-({                                                                     \
-               unsigned long kvirt;                                            \
-       struct page * __xx;                                             \
-                                                                       \
-       kvirt = (unsigned long)__va(pte_val(x) >> (32-PAGE_SHIFT));     \
-       __xx = virt_to_page(kvirt);                                     \
-                                                                       \
-       __xx;                                                           \
-})
-
-#define page_to_pa(page)                                               \
-       (page_to_pfn(page) << PAGE_SHIFT)
-
-#define pfn_to_nid(pfn)                pa_to_nid(((u64)(pfn) << PAGE_SHIFT))
-#define pfn_valid(pfn)                                                 \
-       (((pfn) - node_start_pfn(pfn_to_nid(pfn))) <                    \
-        node_spanned_pages(pfn_to_nid(pfn)))                                   \
-
-#define virt_addr_valid(kaddr) pfn_valid((__pa(kaddr) >> PAGE_SHIFT))
-
-#endif /* CONFIG_DISCONTIGMEM */
-
-#endif /* _ASM_MMZONE_H_ */
diff --git a/include/asm-alpha/module.h b/include/asm-alpha/module.h
deleted file mode 100644 (file)
index 7b63743..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef _ALPHA_MODULE_H
-#define _ALPHA_MODULE_H
-
-struct mod_arch_specific
-{
-       unsigned int gotsecindex;
-};
-
-#define Elf_Sym Elf64_Sym
-#define Elf_Shdr Elf64_Shdr
-#define Elf_Ehdr Elf64_Ehdr
-#define Elf_Phdr Elf64_Phdr
-#define Elf_Dyn Elf64_Dyn
-#define Elf_Rel Elf64_Rel
-#define Elf_Rela Elf64_Rela
-
-#define ARCH_SHF_SMALL SHF_ALPHA_GPREL
-
-#ifdef MODULE
-asm(".section .got,\"aws\",@progbits; .align 3; .previous");
-#endif
-
-#endif /*_ALPHA_MODULE_H*/
diff --git a/include/asm-alpha/msgbuf.h b/include/asm-alpha/msgbuf.h
deleted file mode 100644 (file)
index 9849650..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _ALPHA_MSGBUF_H
-#define _ALPHA_MSGBUF_H
-
-/* 
- * The msqid64_ds structure for alpha architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 2 miscellaneous 64-bit values
- */
-
-struct msqid64_ds {
-       struct ipc64_perm msg_perm;
-       __kernel_time_t msg_stime;      /* last msgsnd time */
-       __kernel_time_t msg_rtime;      /* last msgrcv time */
-       __kernel_time_t msg_ctime;      /* last change time */
-       unsigned long  msg_cbytes;      /* current number of bytes on queue */
-       unsigned long  msg_qnum;        /* number of messages in queue */
-       unsigned long  msg_qbytes;      /* max number of bytes on queue */
-       __kernel_pid_t msg_lspid;       /* pid of last msgsnd */
-       __kernel_pid_t msg_lrpid;       /* last receive pid */
-       unsigned long  __unused1;
-       unsigned long  __unused2;
-};
-
-#endif /* _ALPHA_MSGBUF_H */
diff --git a/include/asm-alpha/mutex.h b/include/asm-alpha/mutex.h
deleted file mode 100644 (file)
index 458c1f7..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Pull in the generic implementation for the mutex fastpath.
- *
- * TODO: implement optimized primitives instead, or leave the generic
- * implementation in place, or pick the atomic_xchg() based generic
- * implementation. (see asm-generic/mutex-xchg.h for details)
- */
-
-#include <asm-generic/mutex-dec.h>
diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h
deleted file mode 100644 (file)
index 0995f9d..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#ifndef _ALPHA_PAGE_H
-#define _ALPHA_PAGE_H
-
-#include <linux/const.h>
-#include <asm/pal.h>
-
-/* PAGE_SHIFT determines the page size */
-#define PAGE_SHIFT     13
-#define PAGE_SIZE      (_AC(1,UL) << PAGE_SHIFT)
-#define PAGE_MASK      (~(PAGE_SIZE-1))
-
-#ifndef __ASSEMBLY__
-
-#define STRICT_MM_TYPECHECKS
-
-extern void clear_page(void *page);
-#define clear_user_page(page, vaddr, pg)       clear_page(page)
-
-#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
-       alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vmaddr)
-#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
-
-extern void copy_page(void * _to, void * _from);
-#define copy_user_page(to, from, vaddr, pg)    copy_page(to, from)
-
-#ifdef STRICT_MM_TYPECHECKS
-/*
- * These are used to make use of C type-checking..
- */
-typedef struct { unsigned long pte; } pte_t;
-typedef struct { unsigned long pmd; } pmd_t;
-typedef struct { unsigned long pgd; } pgd_t;
-typedef struct { unsigned long pgprot; } pgprot_t;
-
-#define pte_val(x)     ((x).pte)
-#define pmd_val(x)     ((x).pmd)
-#define pgd_val(x)     ((x).pgd)
-#define pgprot_val(x)  ((x).pgprot)
-
-#define __pte(x)       ((pte_t) { (x) } )
-#define __pmd(x)       ((pmd_t) { (x) } )
-#define __pgd(x)       ((pgd_t) { (x) } )
-#define __pgprot(x)    ((pgprot_t) { (x) } )
-
-#else
-/*
- * .. while these make it easier on the compiler
- */
-typedef unsigned long pte_t;
-typedef unsigned long pmd_t;
-typedef unsigned long pgd_t;
-typedef unsigned long pgprot_t;
-
-#define pte_val(x)     (x)
-#define pmd_val(x)     (x)
-#define pgd_val(x)     (x)
-#define pgprot_val(x)  (x)
-
-#define __pte(x)       (x)
-#define __pgd(x)       (x)
-#define __pgprot(x)    (x)
-
-#endif /* STRICT_MM_TYPECHECKS */
-
-typedef struct page *pgtable_t;
-
-#ifdef USE_48_BIT_KSEG
-#define PAGE_OFFSET            0xffff800000000000UL
-#else
-#define PAGE_OFFSET            0xfffffc0000000000UL
-#endif
-
-#else
-
-#ifdef USE_48_BIT_KSEG
-#define PAGE_OFFSET            0xffff800000000000
-#else
-#define PAGE_OFFSET            0xfffffc0000000000
-#endif
-
-#endif /* !__ASSEMBLY__ */
-
-#define __pa(x)                        ((unsigned long) (x) - PAGE_OFFSET)
-#define __va(x)                        ((void *)((unsigned long) (x) + PAGE_OFFSET))
-#ifndef CONFIG_DISCONTIGMEM
-#define virt_to_page(kaddr)    pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
-
-#define pfn_valid(pfn)         ((pfn) < max_mapnr)
-#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
-#endif /* CONFIG_DISCONTIGMEM */
-
-#define VM_DATA_DEFAULT_FLAGS          (VM_READ | VM_WRITE | VM_EXEC | \
-                                        VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
-
-#include <asm-generic/memory_model.h>
-#include <asm-generic/page.h>
-
-#endif /* _ALPHA_PAGE_H */
diff --git a/include/asm-alpha/pal.h b/include/asm-alpha/pal.h
deleted file mode 100644 (file)
index 9b4ba0d..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef __ALPHA_PAL_H
-#define __ALPHA_PAL_H
-
-/*
- * Common PAL-code
- */
-#define PAL_halt         0
-#define PAL_cflush       1
-#define PAL_draina       2
-#define PAL_bpt                128
-#define PAL_bugchk     129
-#define PAL_chmk       131
-#define PAL_callsys    131
-#define PAL_imb                134
-#define PAL_rduniq     158
-#define PAL_wruniq     159
-#define PAL_gentrap    170
-#define PAL_nphalt     190
-
-/*
- * VMS specific PAL-code
- */
-#define PAL_swppal     10
-#define PAL_mfpr_vptb  41
-
-/*
- * OSF specific PAL-code
- */
-#define PAL_cserve      9
-#define PAL_wripir     13
-#define PAL_rdmces     16
-#define PAL_wrmces     17
-#define PAL_wrfen      43
-#define PAL_wrvptptr   45
-#define PAL_jtopal     46
-#define PAL_swpctx     48
-#define PAL_wrval      49
-#define PAL_rdval      50
-#define PAL_tbi                51
-#define PAL_wrent      52
-#define PAL_swpipl     53
-#define PAL_rdps       54
-#define PAL_wrkgp      55
-#define PAL_wrusp      56
-#define PAL_wrperfmon  57
-#define PAL_rdusp      58
-#define PAL_whami      60
-#define PAL_retsys     61
-#define PAL_rti                63
-
-#endif /* __ALPHA_PAL_H */
diff --git a/include/asm-alpha/param.h b/include/asm-alpha/param.h
deleted file mode 100644 (file)
index e691ecf..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _ASM_ALPHA_PARAM_H
-#define _ASM_ALPHA_PARAM_H
-
-/* ??? Gross.  I don't want to parameterize this, and supposedly the
-   hardware ignores reprogramming.  We also need userland buy-in to the 
-   change in HZ, since this is visible in the wait4 resources etc.  */
-
-#ifdef __KERNEL__
-#define HZ             CONFIG_HZ
-#define USER_HZ                HZ
-#else
-#define HZ             1024
-#endif
-
-#define EXEC_PAGESIZE  8192
-
-#ifndef NOGROUP
-#define NOGROUP                (-1)
-#endif
-
-#define MAXHOSTNAMELEN 64      /* max length of hostname */
-
-#ifdef __KERNEL__
-# define CLOCKS_PER_SEC        HZ      /* frequency at which times() counts */
-#endif
-
-#endif /* _ASM_ALPHA_PARAM_H */
diff --git a/include/asm-alpha/parport.h b/include/asm-alpha/parport.h
deleted file mode 100644 (file)
index c5ee7cb..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * parport.h: platform-specific PC-style parport initialisation
- *
- * Copyright (C) 1999, 2000  Tim Waugh <tim@cyberelk.demon.co.uk>
- *
- * This file should only be included by drivers/parport/parport_pc.c.
- */
-
-#ifndef _ASM_AXP_PARPORT_H
-#define _ASM_AXP_PARPORT_H 1
-
-static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma);
-static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
-{
-       return parport_pc_find_isa_ports (autoirq, autodma);
-}
-
-#endif /* !(_ASM_AXP_PARPORT_H) */
diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h
deleted file mode 100644 (file)
index 2a14302..0000000
+++ /dev/null
@@ -1,276 +0,0 @@
-#ifndef __ALPHA_PCI_H
-#define __ALPHA_PCI_H
-
-#ifdef __KERNEL__
-
-#include <linux/spinlock.h>
-#include <linux/dma-mapping.h>
-#include <asm/scatterlist.h>
-#include <asm/machvec.h>
-
-/*
- * The following structure is used to manage multiple PCI busses.
- */
-
-struct pci_dev;
-struct pci_bus;
-struct resource;
-struct pci_iommu_arena;
-struct page;
-
-/* A controller.  Used to manage multiple PCI busses.  */
-
-struct pci_controller {
-       struct pci_controller *next;
-        struct pci_bus *bus;
-       struct resource *io_space;
-       struct resource *mem_space;
-
-       /* The following are for reporting to userland.  The invariant is
-          that if we report a BWX-capable dense memory, we do not report
-          a sparse memory at all, even if it exists.  */
-       unsigned long sparse_mem_base;
-       unsigned long dense_mem_base;
-       unsigned long sparse_io_base;
-       unsigned long dense_io_base;
-
-       /* This one's for the kernel only.  It's in KSEG somewhere.  */
-       unsigned long config_space_base;
-
-       unsigned int index;
-       /* For compatibility with current (as of July 2003) pciutils
-          and XFree86. Eventually will be removed. */
-       unsigned int need_domain_info;
-
-       struct pci_iommu_arena *sg_pci;
-       struct pci_iommu_arena *sg_isa;
-
-       void *sysdata;
-};
-
-/* Override the logic in pci_scan_bus for skipping already-configured
-   bus numbers.  */
-
-#define pcibios_assign_all_busses()    1
-#define pcibios_scan_all_fns(a, b)     0
-
-#define PCIBIOS_MIN_IO         alpha_mv.min_io_address
-#define PCIBIOS_MIN_MEM                alpha_mv.min_mem_address
-
-extern void pcibios_set_master(struct pci_dev *dev);
-
-extern inline void pcibios_penalize_isa_irq(int irq, int active)
-{
-       /* We don't do dynamic PCI IRQ allocation */
-}
-
-/* IOMMU controls.  */
-
-/* The PCI address space does not equal the physical memory address space.
-   The networking and block device layers use this boolean for bounce buffer
-   decisions.  */
-#define PCI_DMA_BUS_IS_PHYS  0
-
-/* Allocate and map kernel buffer using consistent mode DMA for PCI
-   device.  Returns non-NULL cpu-view pointer to the buffer if
-   successful and sets *DMA_ADDRP to the pci side dma address as well,
-   else DMA_ADDRP is undefined.  */
-
-extern void *__pci_alloc_consistent(struct pci_dev *, size_t,
-                                   dma_addr_t *, gfp_t);
-static inline void *
-pci_alloc_consistent(struct pci_dev *dev, size_t size, dma_addr_t *dma)
-{
-       return __pci_alloc_consistent(dev, size, dma, GFP_ATOMIC);
-}
-
-/* Free and unmap a consistent DMA buffer.  CPU_ADDR and DMA_ADDR must
-   be values that were returned from pci_alloc_consistent.  SIZE must
-   be the same as what as passed into pci_alloc_consistent.
-   References to the memory and mappings associated with CPU_ADDR or
-   DMA_ADDR past this call are illegal.  */
-
-extern void pci_free_consistent(struct pci_dev *, size_t, void *, dma_addr_t);
-
-/* Map a single buffer of the indicate size for PCI DMA in streaming mode.
-   The 32-bit PCI bus mastering address to use is returned.  Once the device
-   is given the dma address, the device owns this memory until either
-   pci_unmap_single or pci_dma_sync_single_for_cpu is performed.  */
-
-extern dma_addr_t pci_map_single(struct pci_dev *, void *, size_t, int);
-
-/* Likewise, but for a page instead of an address.  */
-extern dma_addr_t pci_map_page(struct pci_dev *, struct page *,
-                              unsigned long, size_t, int);
-
-/* Test for pci_map_single or pci_map_page having generated an error.  */
-
-static inline int
-pci_dma_mapping_error(struct pci_dev *pdev, dma_addr_t dma_addr)
-{
-       return dma_addr == 0;
-}
-
-/* Unmap a single streaming mode DMA translation.  The DMA_ADDR and
-   SIZE must match what was provided for in a previous pci_map_single
-   call.  All other usages are undefined.  After this call, reads by
-   the cpu to the buffer are guaranteed to see whatever the device
-   wrote there.  */
-
-extern void pci_unmap_single(struct pci_dev *, dma_addr_t, size_t, int);
-extern void pci_unmap_page(struct pci_dev *, dma_addr_t, size_t, int);
-
-/* pci_unmap_{single,page} is not a nop, thus... */
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)      \
-       dma_addr_t ADDR_NAME;
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)                \
-       __u32 LEN_NAME;
-#define pci_unmap_addr(PTR, ADDR_NAME)                 \
-       ((PTR)->ADDR_NAME)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL)                \
-       (((PTR)->ADDR_NAME) = (VAL))
-#define pci_unmap_len(PTR, LEN_NAME)                   \
-       ((PTR)->LEN_NAME)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL)          \
-       (((PTR)->LEN_NAME) = (VAL))
-
-/* Map a set of buffers described by scatterlist in streaming mode for
-   PCI DMA.  This is the scatter-gather version of the above
-   pci_map_single interface.  Here the scatter gather list elements
-   are each tagged with the appropriate PCI dma address and length.
-   They are obtained via sg_dma_{address,length}(SG).
-
-   NOTE: An implementation may be able to use a smaller number of DMA
-   address/length pairs than there are SG table elements.  (for
-   example via virtual mapping capabilities) The routine returns the
-   number of addr/length pairs actually used, at most nents.
-
-   Device ownership issues as mentioned above for pci_map_single are
-   the same here.  */
-
-extern int pci_map_sg(struct pci_dev *, struct scatterlist *, int, int);
-
-/* Unmap a set of streaming mode DMA translations.  Again, cpu read
-   rules concerning calls here are the same as for pci_unmap_single()
-   above.  */
-
-extern void pci_unmap_sg(struct pci_dev *, struct scatterlist *, int, int);
-
-/* Make physical memory consistent for a single streaming mode DMA
-   translation after a transfer and device currently has ownership
-   of the buffer.
-
-   If you perform a pci_map_single() but wish to interrogate the
-   buffer using the cpu, yet do not wish to teardown the PCI dma
-   mapping, you must call this function before doing so.  At the next
-   point you give the PCI dma address back to the card, you must first
-   perform a pci_dma_sync_for_device, and then the device again owns
-   the buffer.  */
-
-static inline void
-pci_dma_sync_single_for_cpu(struct pci_dev *dev, dma_addr_t dma_addr,
-                           long size, int direction)
-{
-       /* Nothing to do.  */
-}
-
-static inline void
-pci_dma_sync_single_for_device(struct pci_dev *dev, dma_addr_t dma_addr,
-                              size_t size, int direction)
-{
-       /* Nothing to do.  */
-}
-
-/* Make physical memory consistent for a set of streaming mode DMA
-   translations after a transfer.  The same as pci_dma_sync_single_*
-   but for a scatter-gather list, same rules and usage.  */
-
-static inline void
-pci_dma_sync_sg_for_cpu(struct pci_dev *dev, struct scatterlist *sg,
-                       int nents, int direction)
-{
-       /* Nothing to do.  */
-}
-
-static inline void
-pci_dma_sync_sg_for_device(struct pci_dev *dev, struct scatterlist *sg,
-                          int nents, int direction)
-{
-       /* Nothing to do.  */
-}
-
-/* Return whether the given PCI device DMA address mask can
-   be supported properly.  For example, if your device can
-   only drive the low 24-bits during PCI bus mastering, then
-   you would pass 0x00ffffff as the mask to this function.  */
-
-extern int pci_dma_supported(struct pci_dev *hwdev, u64 mask);
-
-#ifdef CONFIG_PCI
-static inline void pci_dma_burst_advice(struct pci_dev *pdev,
-                                       enum pci_dma_burst_strategy *strat,
-                                       unsigned long *strategy_parameter)
-{
-       unsigned long cacheline_size;
-       u8 byte;
-
-       pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &byte);
-       if (byte == 0)
-               cacheline_size = 1024;
-       else
-               cacheline_size = (int) byte * 4;
-
-       *strat = PCI_DMA_BURST_BOUNDARY;
-       *strategy_parameter = cacheline_size;
-}
-#endif
-
-/* TODO: integrate with include/asm-generic/pci.h ? */
-static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
-{
-       return channel ? 15 : 14;
-}
-
-extern void pcibios_resource_to_bus(struct pci_dev *, struct pci_bus_region *,
-                                   struct resource *);
-
-extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
-                                   struct pci_bus_region *region);
-
-static inline struct resource *
-pcibios_select_root(struct pci_dev *pdev, struct resource *res)
-{
-       struct resource *root = NULL;
-
-       if (res->flags & IORESOURCE_IO)
-               root = &ioport_resource;
-       if (res->flags & IORESOURCE_MEM)
-               root = &iomem_resource;
-
-       return root;
-}
-
-#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
-
-static inline int pci_proc_domain(struct pci_bus *bus)
-{
-       struct pci_controller *hose = bus->sysdata;
-       return hose->need_domain_info;
-}
-
-struct pci_dev *alpha_gendev_to_pci(struct device *dev);
-
-#endif /* __KERNEL__ */
-
-/* Values for the `which' argument to sys_pciconfig_iobase.  */
-#define IOBASE_HOSE            0
-#define IOBASE_SPARSE_MEM      1
-#define IOBASE_DENSE_MEM       2
-#define IOBASE_SPARSE_IO       3
-#define IOBASE_DENSE_IO                4
-#define IOBASE_ROOT_BUS                5
-#define IOBASE_FROM_HOSE       0x10000
-
-extern struct pci_dev *isa_bridge;
-
-#endif /* __ALPHA_PCI_H */
diff --git a/include/asm-alpha/percpu.h b/include/asm-alpha/percpu.h
deleted file mode 100644 (file)
index 3495e8e..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef __ALPHA_PERCPU_H
-#define __ALPHA_PERCPU_H
-#include <linux/compiler.h>
-#include <linux/threads.h>
-
-/*
- * Determine the real variable name from the name visible in the
- * kernel sources.
- */
-#define per_cpu_var(var) per_cpu__##var
-
-#ifdef CONFIG_SMP
-
-/*
- * per_cpu_offset() is the offset that has to be added to a
- * percpu variable to get to the instance for a certain processor.
- */
-extern unsigned long __per_cpu_offset[NR_CPUS];
-
-#define per_cpu_offset(x) (__per_cpu_offset[x])
-
-#define __my_cpu_offset per_cpu_offset(raw_smp_processor_id())
-#ifdef CONFIG_DEBUG_PREEMPT
-#define my_cpu_offset per_cpu_offset(smp_processor_id())
-#else
-#define my_cpu_offset __my_cpu_offset
-#endif
-
-#ifndef MODULE
-#define SHIFT_PERCPU_PTR(var, offset) RELOC_HIDE(&per_cpu_var(var), (offset))
-#define PER_CPU_ATTRIBUTES
-#else
-/*
- * To calculate addresses of locally defined variables, GCC uses 32-bit
- * displacement from the GP. Which doesn't work for per cpu variables in
- * modules, as an offset to the kernel per cpu area is way above 4G.
- *
- * This forces allocation of a GOT entry for per cpu variable using
- * ldq instruction with a 'literal' relocation.
- */
-#define SHIFT_PERCPU_PTR(var, offset) ({               \
-       extern int simple_identifier_##var(void);       \
-       unsigned long __ptr, tmp_gp;                    \
-       asm (  "br      %1, 1f                        \n\
-       1:      ldgp    %1, 0(%1)                     \n\
-               ldq %0, per_cpu__" #var"(%1)\t!literal"         \
-               : "=&r"(__ptr), "=&r"(tmp_gp));         \
-       (typeof(&per_cpu_var(var)))(__ptr + (offset)); })
-
-#define PER_CPU_ATTRIBUTES     __used
-
-#endif /* MODULE */
-
-/*
- * A percpu variable may point to a discarded regions. The following are
- * established ways to produce a usable pointer from the percpu variable
- * offset.
- */
-#define per_cpu(var, cpu) \
-       (*SHIFT_PERCPU_PTR(var, per_cpu_offset(cpu)))
-#define __get_cpu_var(var) \
-       (*SHIFT_PERCPU_PTR(var, my_cpu_offset))
-#define __raw_get_cpu_var(var) \
-       (*SHIFT_PERCPU_PTR(var, __my_cpu_offset))
-
-#else /* ! SMP */
-
-#define per_cpu(var, cpu)              (*((void)(cpu), &per_cpu_var(var)))
-#define __get_cpu_var(var)             per_cpu_var(var)
-#define __raw_get_cpu_var(var)         per_cpu_var(var)
-
-#define PER_CPU_ATTRIBUTES
-
-#endif /* SMP */
-
-#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu_var(name)
-
-#endif /* __ALPHA_PERCPU_H */
diff --git a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h
deleted file mode 100644 (file)
index fd09015..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#ifndef _ALPHA_PGALLOC_H
-#define _ALPHA_PGALLOC_H
-
-#include <linux/mm.h>
-#include <linux/mmzone.h>
-
-/*      
- * Allocate and free page tables. The xxx_kernel() versions are
- * used to allocate a kernel page table - this turns on ASN bits
- * if any.
- */
-
-static inline void
-pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t pte)
-{
-       pmd_set(pmd, (pte_t *)(page_to_pa(pte) + PAGE_OFFSET));
-}
-#define pmd_pgtable(pmd) pmd_page(pmd)
-
-static inline void
-pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
-{
-       pmd_set(pmd, pte);
-}
-
-static inline void
-pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
-{
-       pgd_set(pgd, pmd);
-}
-
-extern pgd_t *pgd_alloc(struct mm_struct *mm);
-
-static inline void
-pgd_free(struct mm_struct *mm, pgd_t *pgd)
-{
-       free_page((unsigned long)pgd);
-}
-
-static inline pmd_t *
-pmd_alloc_one(struct mm_struct *mm, unsigned long address)
-{
-       pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
-       return ret;
-}
-
-static inline void
-pmd_free(struct mm_struct *mm, pmd_t *pmd)
-{
-       free_page((unsigned long)pmd);
-}
-
-extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr);
-
-static inline void
-pte_free_kernel(struct mm_struct *mm, pte_t *pte)
-{
-       free_page((unsigned long)pte);
-}
-
-static inline pgtable_t
-pte_alloc_one(struct mm_struct *mm, unsigned long address)
-{
-       pte_t *pte = pte_alloc_one_kernel(mm, address);
-       struct page *page;
-
-       if (!pte)
-               return NULL;
-       page = virt_to_page(pte);
-       pgtable_page_ctor(page);
-       return page;
-}
-
-static inline void
-pte_free(struct mm_struct *mm, pgtable_t page)
-{
-       pgtable_page_dtor(page);
-       __free_page(page);
-}
-
-#define check_pgt_cache()      do { } while (0)
-
-#endif /* _ALPHA_PGALLOC_H */
diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h
deleted file mode 100644 (file)
index 3f0c59f..0000000
+++ /dev/null
@@ -1,380 +0,0 @@
-#ifndef _ALPHA_PGTABLE_H
-#define _ALPHA_PGTABLE_H
-
-#include <asm-generic/4level-fixup.h>
-
-/*
- * This file contains the functions and defines necessary to modify and use
- * the Alpha page table tree.
- *
- * This hopefully works with any standard Alpha page-size, as defined
- * in <asm/page.h> (currently 8192).
- */
-#include <linux/mmzone.h>
-
-#include <asm/page.h>
-#include <asm/processor.h>     /* For TASK_SIZE */
-#include <asm/machvec.h>
-
-struct mm_struct;
-struct vm_area_struct;
-
-/* Certain architectures need to do special things when PTEs
- * within a page table are directly modified.  Thus, the following
- * hook is made available.
- */
-#define set_pte(pteptr, pteval) ((*(pteptr)) = (pteval))
-#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
-
-/* PMD_SHIFT determines the size of the area a second-level page table can map */
-#define PMD_SHIFT      (PAGE_SHIFT + (PAGE_SHIFT-3))
-#define PMD_SIZE       (1UL << PMD_SHIFT)
-#define PMD_MASK       (~(PMD_SIZE-1))
-
-/* PGDIR_SHIFT determines what a third-level page table entry can map */
-#define PGDIR_SHIFT    (PAGE_SHIFT + 2*(PAGE_SHIFT-3))
-#define PGDIR_SIZE     (1UL << PGDIR_SHIFT)
-#define PGDIR_MASK     (~(PGDIR_SIZE-1))
-
-/*
- * Entries per page directory level:  the Alpha is three-level, with
- * all levels having a one-page page table.
- */
-#define PTRS_PER_PTE   (1UL << (PAGE_SHIFT-3))
-#define PTRS_PER_PMD   (1UL << (PAGE_SHIFT-3))
-#define PTRS_PER_PGD   (1UL << (PAGE_SHIFT-3))
-#define USER_PTRS_PER_PGD      (TASK_SIZE / PGDIR_SIZE)
-#define FIRST_USER_ADDRESS     0
-
-/* Number of pointers that fit on a page:  this will go away. */
-#define PTRS_PER_PAGE  (1UL << (PAGE_SHIFT-3))
-
-#ifdef CONFIG_ALPHA_LARGE_VMALLOC
-#define VMALLOC_START          0xfffffe0000000000
-#else
-#define VMALLOC_START          (-2*PGDIR_SIZE)
-#endif
-#define VMALLOC_END            (-PGDIR_SIZE)
-
-/*
- * OSF/1 PAL-code-imposed page table bits
- */
-#define _PAGE_VALID    0x0001
-#define _PAGE_FOR      0x0002  /* used for page protection (fault on read) */
-#define _PAGE_FOW      0x0004  /* used for page protection (fault on write) */
-#define _PAGE_FOE      0x0008  /* used for page protection (fault on exec) */
-#define _PAGE_ASM      0x0010
-#define _PAGE_KRE      0x0100  /* xxx - see below on the "accessed" bit */
-#define _PAGE_URE      0x0200  /* xxx */
-#define _PAGE_KWE      0x1000  /* used to do the dirty bit in software */
-#define _PAGE_UWE      0x2000  /* used to do the dirty bit in software */
-
-/* .. and these are ours ... */
-#define _PAGE_DIRTY    0x20000
-#define _PAGE_ACCESSED 0x40000
-#define _PAGE_FILE     0x80000 /* set:pagecache, unset:swap */
-
-/*
- * NOTE! The "accessed" bit isn't necessarily exact:  it can be kept exactly
- * by software (use the KRE/URE/KWE/UWE bits appropriately), but I'll fake it.
- * Under Linux/AXP, the "accessed" bit just means "read", and I'll just use
- * the KRE/URE bits to watch for it. That way we don't need to overload the
- * KWE/UWE bits with both handling dirty and accessed.
- *
- * Note that the kernel uses the accessed bit just to check whether to page
- * out a page or not, so it doesn't have to be exact anyway.
- */
-
-#define __DIRTY_BITS   (_PAGE_DIRTY | _PAGE_KWE | _PAGE_UWE)
-#define __ACCESS_BITS  (_PAGE_ACCESSED | _PAGE_KRE | _PAGE_URE)
-
-#define _PFN_MASK      0xFFFFFFFF00000000UL
-
-#define _PAGE_TABLE    (_PAGE_VALID | __DIRTY_BITS | __ACCESS_BITS)
-#define _PAGE_CHG_MASK (_PFN_MASK | __DIRTY_BITS | __ACCESS_BITS)
-
-/*
- * All the normal masks have the "page accessed" bits on, as any time they are used,
- * the page is accessed. They are cleared only by the page-out routines
- */
-#define PAGE_NONE      __pgprot(_PAGE_VALID | __ACCESS_BITS | _PAGE_FOR | _PAGE_FOW | _PAGE_FOE)
-#define PAGE_SHARED    __pgprot(_PAGE_VALID | __ACCESS_BITS)
-#define PAGE_COPY      __pgprot(_PAGE_VALID | __ACCESS_BITS | _PAGE_FOW)
-#define PAGE_READONLY  __pgprot(_PAGE_VALID | __ACCESS_BITS | _PAGE_FOW)
-#define PAGE_KERNEL    __pgprot(_PAGE_VALID | _PAGE_ASM | _PAGE_KRE | _PAGE_KWE)
-
-#define _PAGE_NORMAL(x) __pgprot(_PAGE_VALID | __ACCESS_BITS | (x))
-
-#define _PAGE_P(x) _PAGE_NORMAL((x) | (((x) & _PAGE_FOW)?0:_PAGE_FOW))
-#define _PAGE_S(x) _PAGE_NORMAL(x)
-
-/*
- * The hardware can handle write-only mappings, but as the Alpha
- * architecture does byte-wide writes with a read-modify-write
- * sequence, it's not practical to have write-without-read privs.
- * Thus the "-w- -> rw-" and "-wx -> rwx" mapping here (and in
- * arch/alpha/mm/fault.c)
- */
-       /* xwr */
-#define __P000 _PAGE_P(_PAGE_FOE | _PAGE_FOW | _PAGE_FOR)
-#define __P001 _PAGE_P(_PAGE_FOE | _PAGE_FOW)
-#define __P010 _PAGE_P(_PAGE_FOE)
-#define __P011 _PAGE_P(_PAGE_FOE)
-#define __P100 _PAGE_P(_PAGE_FOW | _PAGE_FOR)
-#define __P101 _PAGE_P(_PAGE_FOW)
-#define __P110 _PAGE_P(0)
-#define __P111 _PAGE_P(0)
-
-#define __S000 _PAGE_S(_PAGE_FOE | _PAGE_FOW | _PAGE_FOR)
-#define __S001 _PAGE_S(_PAGE_FOE | _PAGE_FOW)
-#define __S010 _PAGE_S(_PAGE_FOE)
-#define __S011 _PAGE_S(_PAGE_FOE)
-#define __S100 _PAGE_S(_PAGE_FOW | _PAGE_FOR)
-#define __S101 _PAGE_S(_PAGE_FOW)
-#define __S110 _PAGE_S(0)
-#define __S111 _PAGE_S(0)
-
-/*
- * pgprot_noncached() is only for infiniband pci support, and a real
- * implementation for RAM would be more complicated.
- */
-#define pgprot_noncached(prot) (prot)
-
-/*
- * BAD_PAGETABLE is used when we need a bogus page-table, while
- * BAD_PAGE is used for a bogus page.
- *
- * ZERO_PAGE is a global shared page that is always zero:  used
- * for zero-mapped memory areas etc..
- */
-extern pte_t __bad_page(void);
-extern pmd_t * __bad_pagetable(void);
-
-extern unsigned long __zero_page(void);
-
-#define BAD_PAGETABLE  __bad_pagetable()
-#define BAD_PAGE       __bad_page()
-#define ZERO_PAGE(vaddr)       (virt_to_page(ZERO_PGE))
-
-/* number of bits that fit into a memory pointer */
-#define BITS_PER_PTR                   (8*sizeof(unsigned long))
-
-/* to align the pointer to a pointer address */
-#define PTR_MASK                       (~(sizeof(void*)-1))
-
-/* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */
-#define SIZEOF_PTR_LOG2                        3
-
-/* to find an entry in a page-table */
-#define PAGE_PTR(address)              \
-  ((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
-
-/*
- * On certain platforms whose physical address space can overlap KSEG,
- * namely EV6 and above, we must re-twiddle the physaddr to restore the
- * correct high-order bits.
- *
- * This is extremely confusing until you realize that this is actually
- * just working around a userspace bug.  The X server was intending to
- * provide the physical address but instead provided the KSEG address.
- * Or tried to, except it's not representable.
- * 
- * On Tsunami there's nothing meaningful at 0x40000000000, so this is
- * a safe thing to do.  Come the first core logic that does put something
- * in this area -- memory or whathaveyou -- then this hack will have
- * to go away.  So be prepared!
- */
-
-#if defined(CONFIG_ALPHA_GENERIC) && defined(USE_48_BIT_KSEG)
-#error "EV6-only feature in a generic kernel"
-#endif
-#if defined(CONFIG_ALPHA_GENERIC) || \
-    (defined(CONFIG_ALPHA_EV6) && !defined(USE_48_BIT_KSEG))
-#define KSEG_PFN       (0xc0000000000UL >> PAGE_SHIFT)
-#define PHYS_TWIDDLE(pfn) \
-  ((((pfn) & KSEG_PFN) == (0x40000000000UL >> PAGE_SHIFT)) \
-  ? ((pfn) ^= KSEG_PFN) : (pfn))
-#else
-#define PHYS_TWIDDLE(pfn) (pfn)
-#endif
-
-/*
- * Conversion functions:  convert a page and protection to a page entry,
- * and a page entry and page directory to the page they refer to.
- */
-#ifndef CONFIG_DISCONTIGMEM
-#define page_to_pa(page)       (((page) - mem_map) << PAGE_SHIFT)
-
-#define pte_pfn(pte)   (pte_val(pte) >> 32)
-#define pte_page(pte)  pfn_to_page(pte_pfn(pte))
-#define mk_pte(page, pgprot)                                           \
-({                                                                     \
-       pte_t pte;                                                      \
-                                                                       \
-       pte_val(pte) = (page_to_pfn(page) << 32) | pgprot_val(pgprot);  \
-       pte;                                                            \
-})
-#endif
-
-extern inline pte_t pfn_pte(unsigned long physpfn, pgprot_t pgprot)
-{ pte_t pte; pte_val(pte) = (PHYS_TWIDDLE(physpfn) << 32) | pgprot_val(pgprot); return pte; }
-
-extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
-{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; }
-
-extern inline void pmd_set(pmd_t * pmdp, pte_t * ptep)
-{ pmd_val(*pmdp) = _PAGE_TABLE | ((((unsigned long) ptep) - PAGE_OFFSET) << (32-PAGE_SHIFT)); }
-
-extern inline void pgd_set(pgd_t * pgdp, pmd_t * pmdp)
-{ pgd_val(*pgdp) = _PAGE_TABLE | ((((unsigned long) pmdp) - PAGE_OFFSET) << (32-PAGE_SHIFT)); }
-
-
-extern inline unsigned long
-pmd_page_vaddr(pmd_t pmd)
-{
-       return ((pmd_val(pmd) & _PFN_MASK) >> (32-PAGE_SHIFT)) + PAGE_OFFSET;
-}
-
-#ifndef CONFIG_DISCONTIGMEM
-#define pmd_page(pmd)  (mem_map + ((pmd_val(pmd) & _PFN_MASK) >> 32))
-#define pgd_page(pgd)  (mem_map + ((pgd_val(pgd) & _PFN_MASK) >> 32))
-#endif
-
-extern inline unsigned long pgd_page_vaddr(pgd_t pgd)
-{ return PAGE_OFFSET + ((pgd_val(pgd) & _PFN_MASK) >> (32-PAGE_SHIFT)); }
-
-extern inline int pte_none(pte_t pte)          { return !pte_val(pte); }
-extern inline int pte_present(pte_t pte)       { return pte_val(pte) & _PAGE_VALID; }
-extern inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
-{
-       pte_val(*ptep) = 0;
-}
-
-extern inline int pmd_none(pmd_t pmd)          { return !pmd_val(pmd); }
-extern inline int pmd_bad(pmd_t pmd)           { return (pmd_val(pmd) & ~_PFN_MASK) != _PAGE_TABLE; }
-extern inline int pmd_present(pmd_t pmd)       { return pmd_val(pmd) & _PAGE_VALID; }
-extern inline void pmd_clear(pmd_t * pmdp)     { pmd_val(*pmdp) = 0; }
-
-extern inline int pgd_none(pgd_t pgd)          { return !pgd_val(pgd); }
-extern inline int pgd_bad(pgd_t pgd)           { return (pgd_val(pgd) & ~_PFN_MASK) != _PAGE_TABLE; }
-extern inline int pgd_present(pgd_t pgd)       { return pgd_val(pgd) & _PAGE_VALID; }
-extern inline void pgd_clear(pgd_t * pgdp)     { pgd_val(*pgdp) = 0; }
-
-/*
- * The following only work if pte_present() is true.
- * Undefined behaviour if not..
- */
-extern inline int pte_write(pte_t pte)         { return !(pte_val(pte) & _PAGE_FOW); }
-extern inline int pte_dirty(pte_t pte)         { return pte_val(pte) & _PAGE_DIRTY; }
-extern inline int pte_young(pte_t pte)         { return pte_val(pte) & _PAGE_ACCESSED; }
-extern inline int pte_file(pte_t pte)          { return pte_val(pte) & _PAGE_FILE; }
-extern inline int pte_special(pte_t pte)       { return 0; }
-
-extern inline pte_t pte_wrprotect(pte_t pte)   { pte_val(pte) |= _PAGE_FOW; return pte; }
-extern inline pte_t pte_mkclean(pte_t pte)     { pte_val(pte) &= ~(__DIRTY_BITS); return pte; }
-extern inline pte_t pte_mkold(pte_t pte)       { pte_val(pte) &= ~(__ACCESS_BITS); return pte; }
-extern inline pte_t pte_mkwrite(pte_t pte)     { pte_val(pte) &= ~_PAGE_FOW; return pte; }
-extern inline pte_t pte_mkdirty(pte_t pte)     { pte_val(pte) |= __DIRTY_BITS; return pte; }
-extern inline pte_t pte_mkyoung(pte_t pte)     { pte_val(pte) |= __ACCESS_BITS; return pte; }
-extern inline pte_t pte_mkspecial(pte_t pte)   { return pte; }
-
-#define PAGE_DIR_OFFSET(tsk,address) pgd_offset((tsk),(address))
-
-/* to find an entry in a kernel page-table-directory */
-#define pgd_offset_k(address) pgd_offset(&init_mm, (address))
-
-/* to find an entry in a page-table-directory. */
-#define pgd_index(address)     (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
-#define pgd_offset(mm, address)        ((mm)->pgd+pgd_index(address))
-
-/*
- * The smp_read_barrier_depends() in the following functions are required to
- * order the load of *dir (the pointer in the top level page table) with any
- * subsequent load of the returned pmd_t *ret (ret is data dependent on *dir).
- *
- * If this ordering is not enforced, the CPU might load an older value of
- * *ret, which may be uninitialized data. See mm/memory.c:__pte_alloc for
- * more details.
- *
- * Note that we never change the mm->pgd pointer after the task is running, so
- * pgd_offset does not require such a barrier.
- */
-
-/* Find an entry in the second-level page table.. */
-extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
-{
-       pmd_t *ret = (pmd_t *) pgd_page_vaddr(*dir) + ((address >> PMD_SHIFT) & (PTRS_PER_PAGE - 1));
-       smp_read_barrier_depends(); /* see above */
-       return ret;
-}
-
-/* Find an entry in the third-level page table.. */
-extern inline pte_t * pte_offset_kernel(pmd_t * dir, unsigned long address)
-{
-       pte_t *ret = (pte_t *) pmd_page_vaddr(*dir)
-               + ((address >> PAGE_SHIFT) & (PTRS_PER_PAGE - 1));
-       smp_read_barrier_depends(); /* see above */
-       return ret;
-}
-
-#define pte_offset_map(dir,addr)       pte_offset_kernel((dir),(addr))
-#define pte_offset_map_nested(dir,addr)        pte_offset_kernel((dir),(addr))
-#define pte_unmap(pte)                 do { } while (0)
-#define pte_unmap_nested(pte)          do { } while (0)
-
-extern pgd_t swapper_pg_dir[1024];
-
-/*
- * The Alpha doesn't have any external MMU info:  the kernel page
- * tables contain all the necessary information.
- */
-extern inline void update_mmu_cache(struct vm_area_struct * vma,
-       unsigned long address, pte_t pte)
-{
-}
-
-/*
- * Non-present pages:  high 24 bits are offset, next 8 bits type,
- * low 32 bits zero.
- */
-extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
-{ pte_t pte; pte_val(pte) = (type << 32) | (offset << 40); return pte; }
-
-#define __swp_type(x)          (((x).val >> 32) & 0xff)
-#define __swp_offset(x)                ((x).val >> 40)
-#define __swp_entry(type, off) ((swp_entry_t) { pte_val(mk_swap_pte((type), (off))) })
-#define __pte_to_swp_entry(pte)        ((swp_entry_t) { pte_val(pte) })
-#define __swp_entry_to_pte(x)  ((pte_t) { (x).val })
-
-#define pte_to_pgoff(pte)      (pte_val(pte) >> 32)
-#define pgoff_to_pte(off)      ((pte_t) { ((off) << 32) | _PAGE_FILE })
-
-#define PTE_FILE_MAX_BITS      32
-
-#ifndef CONFIG_DISCONTIGMEM
-#define kern_addr_valid(addr)  (1)
-#endif
-
-#define io_remap_pfn_range(vma, start, pfn, size, prot)        \
-               remap_pfn_range(vma, start, pfn, size, prot)
-
-#define pte_ERROR(e) \
-       printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
-#define pmd_ERROR(e) \
-       printk("%s:%d: bad pmd %016lx.\n", __FILE__, __LINE__, pmd_val(e))
-#define pgd_ERROR(e) \
-       printk("%s:%d: bad pgd %016lx.\n", __FILE__, __LINE__, pgd_val(e))
-
-extern void paging_init(void);
-
-#include <asm-generic/pgtable.h>
-
-/*
- * No page table caches to initialise
- */
-#define pgtable_cache_init()   do { } while (0)
-
-/* We have our own get_unmapped_area to cope with ADDR_LIMIT_32BIT.  */
-#define HAVE_ARCH_UNMAPPED_AREA
-
-#endif /* _ALPHA_PGTABLE_H */
diff --git a/include/asm-alpha/poll.h b/include/asm-alpha/poll.h
deleted file mode 100644 (file)
index c98509d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <asm-generic/poll.h>
diff --git a/include/asm-alpha/posix_types.h b/include/asm-alpha/posix_types.h
deleted file mode 100644 (file)
index db16741..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#ifndef _ALPHA_POSIX_TYPES_H
-#define _ALPHA_POSIX_TYPES_H
-
-/*
- * This file is generally used by user-level software, so you need to
- * be a little careful about namespace pollution etc.  Also, we cannot
- * assume GCC is being used.
- */
-
-typedef unsigned int   __kernel_ino_t;
-typedef unsigned int   __kernel_mode_t;
-typedef unsigned int   __kernel_nlink_t;
-typedef long           __kernel_off_t;
-typedef long long      __kernel_loff_t;
-typedef int            __kernel_pid_t;
-typedef int            __kernel_ipc_pid_t;
-typedef unsigned int   __kernel_uid_t;
-typedef unsigned int   __kernel_gid_t;
-typedef unsigned long  __kernel_size_t;
-typedef long           __kernel_ssize_t;
-typedef long           __kernel_ptrdiff_t;
-typedef long           __kernel_time_t;
-typedef long           __kernel_suseconds_t;
-typedef long           __kernel_clock_t;
-typedef int            __kernel_daddr_t;
-typedef char *         __kernel_caddr_t;
-typedef unsigned long  __kernel_sigset_t;      /* at least 32 bits */
-typedef unsigned short __kernel_uid16_t;
-typedef unsigned short __kernel_gid16_t;
-typedef int            __kernel_clockid_t;
-typedef int            __kernel_timer_t;
-
-typedef struct {
-       int     val[2];
-} __kernel_fsid_t;
-
-typedef __kernel_uid_t __kernel_old_uid_t;
-typedef __kernel_gid_t __kernel_old_gid_t;
-typedef __kernel_uid_t __kernel_uid32_t;
-typedef __kernel_gid_t __kernel_gid32_t;
-
-typedef unsigned int   __kernel_old_dev_t;
-
-#ifdef __KERNEL__
-
-#ifndef __GNUC__
-
-#define        __FD_SET(d, set)        ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
-#define        __FD_CLR(d, set)        ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
-#define        __FD_ISSET(d, set)      (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0)
-#define        __FD_ZERO(set)  \
-  ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set)))
-
-#else /* __GNUC__ */
-
-/* With GNU C, use inline functions instead so args are evaluated only once: */
-
-#undef __FD_SET
-static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
-{
-       unsigned long _tmp = fd / __NFDBITS;
-       unsigned long _rem = fd % __NFDBITS;
-       fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
-}
-
-#undef __FD_CLR
-static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
-{
-       unsigned long _tmp = fd / __NFDBITS;
-       unsigned long _rem = fd % __NFDBITS;
-       fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
-}
-
-#undef __FD_ISSET
-static __inline__ int __FD_ISSET(unsigned long fd, const __kernel_fd_set *p)
-{ 
-       unsigned long _tmp = fd / __NFDBITS;
-       unsigned long _rem = fd % __NFDBITS;
-       return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0;
-}
-
-/*
- * This will unroll the loop for the normal constant case (8 ints,
- * for a 256-bit fd_set)
- */
-#undef __FD_ZERO
-static __inline__ void __FD_ZERO(__kernel_fd_set *p)
-{
-       unsigned long *tmp = p->fds_bits;
-       int i;
-
-       if (__builtin_constant_p(__FDSET_LONGS)) {
-               switch (__FDSET_LONGS) {
-                     case 16:
-                       tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
-                       tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
-                       tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;
-                       tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
-                       return;
-
-                     case 8:
-                       tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
-                       tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
-                       return;
-
-                     case 4:
-                       tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
-                       return;
-               }
-       }
-       i = __FDSET_LONGS;
-       while (i) {
-               i--;
-               *tmp = 0;
-               tmp++;
-       }
-}
-
-#endif /* __GNUC__ */
-
-#endif /* __KERNEL__ */
-
-#endif /* _ALPHA_POSIX_TYPES_H */
diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h
deleted file mode 100644 (file)
index 94afe58..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * include/asm-alpha/processor.h
- *
- * Copyright (C) 1994 Linus Torvalds
- */
-
-#ifndef __ASM_ALPHA_PROCESSOR_H
-#define __ASM_ALPHA_PROCESSOR_H
-
-#include <linux/personality.h> /* for ADDR_LIMIT_32BIT */
-
-/*
- * Returns current instruction pointer ("program counter").
- */
-#define current_text_addr() \
-  ({ void *__pc; __asm__ ("br %0,.+4" : "=r"(__pc)); __pc; })
-
-/*
- * We have a 42-bit user address space: 4TB user VM...
- */
-#define TASK_SIZE (0x40000000000UL)
-
-#define STACK_TOP \
-  (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL)
-
-#define STACK_TOP_MAX  0x00120000000UL
-
-/* This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE \
-  ((current->personality & ADDR_LIMIT_32BIT) ? 0x40000000 : TASK_SIZE / 2)
-
-typedef struct {
-       unsigned long seg;
-} mm_segment_t;
-
-/* This is dead.  Everything has been moved to thread_info.  */
-struct thread_struct { };
-#define INIT_THREAD  { }
-
-/* Return saved PC of a blocked thread.  */
-struct task_struct;
-extern unsigned long thread_saved_pc(struct task_struct *);
-
-/* Do necessary setup to start up a newly executed thread.  */
-extern void start_thread(struct pt_regs *, unsigned long, unsigned long);
-
-/* Free all resources held by a thread. */
-extern void release_thread(struct task_struct *);
-
-/* Prepare to copy thread state - unlazy all lazy status */
-#define prepare_to_copy(tsk)   do { } while (0)
-
-/* Create a kernel thread without removing it from tasklists.  */
-extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
-
-unsigned long get_wchan(struct task_struct *p);
-
-#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
-
-#define KSTK_ESP(tsk) \
-  ((tsk) == current ? rdusp() : task_thread_info(tsk)->pcb.usp)
-
-#define cpu_relax()    barrier()
-
-#define ARCH_HAS_PREFETCH
-#define ARCH_HAS_PREFETCHW
-#define ARCH_HAS_SPINLOCK_PREFETCH
-
-#ifndef CONFIG_SMP
-/* Nothing to prefetch. */
-#define spin_lock_prefetch(lock)       do { } while (0)
-#endif
-
-extern inline void prefetch(const void *ptr)  
-{ 
-       __builtin_prefetch(ptr, 0, 3);
-}
-
-extern inline void prefetchw(const void *ptr)  
-{
-       __builtin_prefetch(ptr, 1, 3);
-}
-
-#ifdef CONFIG_SMP
-extern inline void spin_lock_prefetch(const void *ptr)  
-{
-       __builtin_prefetch(ptr, 1, 3);
-}
-#endif
-
-#endif /* __ASM_ALPHA_PROCESSOR_H */
diff --git a/include/asm-alpha/ptrace.h b/include/asm-alpha/ptrace.h
deleted file mode 100644 (file)
index 32c7a5c..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#ifndef _ASMAXP_PTRACE_H
-#define _ASMAXP_PTRACE_H
-
-
-/*
- * This struct defines the way the registers are stored on the
- * kernel stack during a system call or other kernel entry
- *
- * NOTE! I want to minimize the overhead of system calls, so this
- * struct has as little information as possible.  I does not have
- *
- *  - floating point regs: the kernel doesn't change those
- *  - r9-15: saved by the C compiler
- *
- * This makes "fork()" and "exec()" a bit more complex, but should
- * give us low system call latency.
- */
-
-struct pt_regs {
-       unsigned long r0;
-       unsigned long r1;
-       unsigned long r2;
-       unsigned long r3;
-       unsigned long r4;
-       unsigned long r5;
-       unsigned long r6;
-       unsigned long r7;
-       unsigned long r8;
-       unsigned long r19;
-       unsigned long r20;
-       unsigned long r21;
-       unsigned long r22;
-       unsigned long r23;
-       unsigned long r24;
-       unsigned long r25;
-       unsigned long r26;
-       unsigned long r27;
-       unsigned long r28;
-       unsigned long hae;
-/* JRP - These are the values provided to a0-a2 by PALcode */
-       unsigned long trap_a0;
-       unsigned long trap_a1;
-       unsigned long trap_a2;
-/* These are saved by PAL-code: */
-       unsigned long ps;
-       unsigned long pc;
-       unsigned long gp;
-       unsigned long r16;
-       unsigned long r17;
-       unsigned long r18;
-};
-
-/*
- * This is the extended stack used by signal handlers and the context
- * switcher: it's pushed after the normal "struct pt_regs".
- */
-struct switch_stack {
-       unsigned long r9;
-       unsigned long r10;
-       unsigned long r11;
-       unsigned long r12;
-       unsigned long r13;
-       unsigned long r14;
-       unsigned long r15;
-       unsigned long r26;
-       unsigned long fp[32];   /* fp[31] is fpcr */
-};
-
-#ifdef __KERNEL__
-
-#define user_mode(regs) (((regs)->ps & 8) != 0)
-#define instruction_pointer(regs) ((regs)->pc)
-#define profile_pc(regs) instruction_pointer(regs)
-extern void show_regs(struct pt_regs *);
-
-#define task_pt_regs(task) \
-  ((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1)
-
-#define force_successful_syscall_return() (task_pt_regs(current)->r0 = 0)
-
-#endif
-
-#endif
diff --git a/include/asm-alpha/reg.h b/include/asm-alpha/reg.h
deleted file mode 100644 (file)
index 86ff916..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef __reg_h__
-#define __reg_h__
-
-/*
- * Exception frame offsets.
- */
-#define EF_V0          0
-#define EF_T0          1
-#define EF_T1          2
-#define EF_T2          3
-#define EF_T3          4
-#define EF_T4          5
-#define EF_T5          6
-#define EF_T6          7
-#define EF_T7          8
-#define EF_S0          9
-#define EF_S1          10
-#define EF_S2          11
-#define EF_S3          12
-#define EF_S4          13
-#define EF_S5          14
-#define EF_S6          15
-#define EF_A3          16
-#define EF_A4          17
-#define EF_A5          18
-#define EF_T8          19
-#define EF_T9          20
-#define EF_T10         21
-#define EF_T11         22
-#define EF_RA          23
-#define EF_T12         24
-#define EF_AT          25
-#define EF_SP          26
-#define EF_PS          27
-#define EF_PC          28
-#define EF_GP          29
-#define EF_A0          30
-#define EF_A1          31
-#define EF_A2          32
-
-#define EF_SIZE                (33*8)
-#define HWEF_SIZE      (6*8)           /* size of PAL frame (PS-A2) */
-
-#define EF_SSIZE       (EF_SIZE - HWEF_SIZE)
-
-/*
- * Map register number into core file offset.
- */
-#define CORE_REG(reg, ubase) \
-       (((unsigned long *)((unsigned long)(ubase)))[reg])
-
-#endif /* __reg_h__ */
diff --git a/include/asm-alpha/regdef.h b/include/asm-alpha/regdef.h
deleted file mode 100644 (file)
index 142df9c..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef __alpha_regdef_h__
-#define __alpha_regdef_h__
-
-#define v0     $0      /* function return value */
-
-#define t0     $1      /* temporary registers (caller-saved) */
-#define t1     $2
-#define t2     $3
-#define t3     $4
-#define t4     $5
-#define t5     $6
-#define t6     $7
-#define t7     $8
-
-#define        s0      $9      /* saved-registers (callee-saved registers) */
-#define        s1      $10
-#define        s2      $11
-#define        s3      $12
-#define        s4      $13
-#define        s5      $14
-#define        s6      $15
-#define        fp      s6      /* frame-pointer (s6 in frame-less procedures) */
-
-#define a0     $16     /* argument registers (caller-saved) */
-#define a1     $17
-#define a2     $18
-#define a3     $19
-#define a4     $20
-#define a5     $21
-
-#define t8     $22     /* more temps (caller-saved) */
-#define t9     $23
-#define t10    $24
-#define t11    $25
-#define ra     $26     /* return address register */
-#define t12    $27
-
-#define pv     t12     /* procedure-variable register */
-#define AT     $at     /* assembler temporary */
-#define gp     $29     /* global pointer */
-#define sp     $30     /* stack pointer */
-#define zero   $31     /* reads as zero, writes are noops */
-
-#endif /* __alpha_regdef_h__ */
diff --git a/include/asm-alpha/resource.h b/include/asm-alpha/resource.h
deleted file mode 100644 (file)
index c10874f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _ALPHA_RESOURCE_H
-#define _ALPHA_RESOURCE_H
-
-/*
- * Alpha/Linux-specific ordering of these four resource limit IDs,
- * the rest comes from the generic header:
- */
-#define RLIMIT_NOFILE          6       /* max number of open files */
-#define RLIMIT_AS              7       /* address space limit */
-#define RLIMIT_NPROC           8       /* max number of processes */
-#define RLIMIT_MEMLOCK         9       /* max locked-in-memory address space */
-
-/*
- * SuS says limits have to be unsigned.  Fine, it's unsigned, but
- * we retain the old value for compatibility, especially with DU. 
- * When you run into the 2^63 barrier, you call me.
- */
-#define RLIM_INFINITY          0x7ffffffffffffffful
-
-#include <asm-generic/resource.h>
-
-#endif /* _ALPHA_RESOURCE_H */
diff --git a/include/asm-alpha/rtc.h b/include/asm-alpha/rtc.h
deleted file mode 100644 (file)
index 4e854b1..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef _ALPHA_RTC_H
-#define _ALPHA_RTC_H
-
-/*
- * Alpha uses the default access methods for the RTC.
- */
-
-#include <asm-generic/rtc.h>
-
-#endif
diff --git a/include/asm-alpha/rwsem.h b/include/asm-alpha/rwsem.h
deleted file mode 100644 (file)
index 1570c0b..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-#ifndef _ALPHA_RWSEM_H
-#define _ALPHA_RWSEM_H
-
-/*
- * Written by Ivan Kokshaysky <ink@jurassic.park.msu.ru>, 2001.
- * Based on asm-alpha/semaphore.h and asm-i386/rwsem.h
- */
-
-#ifndef _LINUX_RWSEM_H
-#error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead"
-#endif
-
-#ifdef __KERNEL__
-
-#include <linux/compiler.h>
-#include <linux/list.h>
-#include <linux/spinlock.h>
-
-struct rwsem_waiter;
-
-extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem);
-extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem);
-extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *);
-extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
-
-/*
- * the semaphore definition
- */
-struct rw_semaphore {
-       long                    count;
-#define RWSEM_UNLOCKED_VALUE           0x0000000000000000L
-#define RWSEM_ACTIVE_BIAS              0x0000000000000001L
-#define RWSEM_ACTIVE_MASK              0x00000000ffffffffL
-#define RWSEM_WAITING_BIAS             (-0x0000000100000000L)
-#define RWSEM_ACTIVE_READ_BIAS         RWSEM_ACTIVE_BIAS
-#define RWSEM_ACTIVE_WRITE_BIAS                (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
-       spinlock_t              wait_lock;
-       struct list_head        wait_list;
-};
-
-#define __RWSEM_INITIALIZER(name) \
-       { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
-       LIST_HEAD_INIT((name).wait_list) }
-
-#define DECLARE_RWSEM(name) \
-       struct rw_semaphore name = __RWSEM_INITIALIZER(name)
-
-static inline void init_rwsem(struct rw_semaphore *sem)
-{
-       sem->count = RWSEM_UNLOCKED_VALUE;
-       spin_lock_init(&sem->wait_lock);
-       INIT_LIST_HEAD(&sem->wait_list);
-}
-
-static inline void __down_read(struct rw_semaphore *sem)
-{
-       long oldcount;
-#ifndef        CONFIG_SMP
-       oldcount = sem->count;
-       sem->count += RWSEM_ACTIVE_READ_BIAS;
-#else
-       long temp;
-       __asm__ __volatile__(
-       "1:     ldq_l   %0,%1\n"
-       "       addq    %0,%3,%2\n"
-       "       stq_c   %2,%1\n"
-       "       beq     %2,2f\n"
-       "       mb\n"
-       ".subsection 2\n"
-       "2:     br      1b\n"
-       ".previous"
-       :"=&r" (oldcount), "=m" (sem->count), "=&r" (temp)
-       :"Ir" (RWSEM_ACTIVE_READ_BIAS), "m" (sem->count) : "memory");
-#endif
-       if (unlikely(oldcount < 0))
-               rwsem_down_read_failed(sem);
-}
-
-/*
- * trylock for reading -- returns 1 if successful, 0 if contention
- */
-static inline int __down_read_trylock(struct rw_semaphore *sem)
-{
-       long old, new, res;
-
-       res = sem->count;
-       do {
-               new = res + RWSEM_ACTIVE_READ_BIAS;
-               if (new <= 0)
-                       break;
-               old = res;
-               res = cmpxchg(&sem->count, old, new);
-       } while (res != old);
-       return res >= 0 ? 1 : 0;
-}
-
-static inline void __down_write(struct rw_semaphore *sem)
-{
-       long oldcount;
-#ifndef        CONFIG_SMP
-       oldcount = sem->count;
-       sem->count += RWSEM_ACTIVE_WRITE_BIAS;
-#else
-       long temp;
-       __asm__ __volatile__(
-       "1:     ldq_l   %0,%1\n"
-       "       addq    %0,%3,%2\n"
-       "       stq_c   %2,%1\n"
-       "       beq     %2,2f\n"
-       "       mb\n"
-       ".subsection 2\n"
-       "2:     br      1b\n"
-       ".previous"
-       :"=&r" (oldcount), "=m" (sem->count), "=&r" (temp)
-       :"Ir" (RWSEM_ACTIVE_WRITE_BIAS), "m" (sem->count) : "memory");
-#endif
-       if (unlikely(oldcount))
-               rwsem_down_write_failed(sem);
-}
-
-/*
- * trylock for writing -- returns 1 if successful, 0 if contention
- */
-static inline int __down_write_trylock(struct rw_semaphore *sem)
-{
-       long ret = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE,
-                          RWSEM_ACTIVE_WRITE_BIAS);
-       if (ret == RWSEM_UNLOCKED_VALUE)
-               return 1;
-       return 0;
-}
-
-static inline void __up_read(struct rw_semaphore *sem)
-{
-       long oldcount;
-#ifndef        CONFIG_SMP
-       oldcount = sem->count;
-       sem->count -= RWSEM_ACTIVE_READ_BIAS;
-#else
-       long temp;
-       __asm__ __volatile__(
-       "       mb\n"
-       "1:     ldq_l   %0,%1\n"
-       "       subq    %0,%3,%2\n"
-       "       stq_c   %2,%1\n"
-       "       beq     %2,2f\n"
-       ".subsection 2\n"
-       "2:     br      1b\n"
-       ".previous"
-       :"=&r" (oldcount), "=m" (sem->count), "=&r" (temp)
-       :"Ir" (RWSEM_ACTIVE_READ_BIAS), "m" (sem->count) : "memory");
-#endif
-       if (unlikely(oldcount < 0))
-               if ((int)oldcount - RWSEM_ACTIVE_READ_BIAS == 0)
-                       rwsem_wake(sem);
-}
-
-static inline void __up_write(struct rw_semaphore *sem)
-{
-       long count;
-#ifndef        CONFIG_SMP
-       sem->count -= RWSEM_ACTIVE_WRITE_BIAS;
-       count = sem->count;
-#else
-       long temp;
-       __asm__ __volatile__(
-       "       mb\n"
-       "1:     ldq_l   %0,%1\n"
-       "       subq    %0,%3,%2\n"
-       "       stq_c   %2,%1\n"
-       "       beq     %2,2f\n"
-       "       subq    %0,%3,%0\n"
-       ".subsection 2\n"
-       "2:     br      1b\n"
-       ".previous"
-       :"=&r" (count), "=m" (sem->count), "=&r" (temp)
-       :"Ir" (RWSEM_ACTIVE_WRITE_BIAS), "m" (sem->count) : "memory");
-#endif
-       if (unlikely(count))
-               if ((int)count == 0)
-                       rwsem_wake(sem);
-}
-
-/*
- * downgrade write lock to read lock
- */
-static inline void __downgrade_write(struct rw_semaphore *sem)
-{
-       long oldcount;
-#ifndef        CONFIG_SMP
-       oldcount = sem->count;
-       sem->count -= RWSEM_WAITING_BIAS;
-#else
-       long temp;
-       __asm__ __volatile__(
-       "1:     ldq_l   %0,%1\n"
-       "       addq    %0,%3,%2\n"
-       "       stq_c   %2,%1\n"
-       "       beq     %2,2f\n"
-       "       mb\n"
-       ".subsection 2\n"
-       "2:     br      1b\n"
-       ".previous"
-       :"=&r" (oldcount), "=m" (sem->count), "=&r" (temp)
-       :"Ir" (-RWSEM_WAITING_BIAS), "m" (sem->count) : "memory");
-#endif
-       if (unlikely(oldcount < 0))
-               rwsem_downgrade_wake(sem);
-}
-
-static inline void rwsem_atomic_add(long val, struct rw_semaphore *sem)
-{
-#ifndef        CONFIG_SMP
-       sem->count += val;
-#else
-       long temp;
-       __asm__ __volatile__(
-       "1:     ldq_l   %0,%1\n"
-       "       addq    %0,%2,%0\n"
-       "       stq_c   %0,%1\n"
-       "       beq     %0,2f\n"
-       ".subsection 2\n"
-       "2:     br      1b\n"
-       ".previous"
-       :"=&r" (temp), "=m" (sem->count)
-       :"Ir" (val), "m" (sem->count));
-#endif
-}
-
-static inline long rwsem_atomic_update(long val, struct rw_semaphore *sem)
-{
-#ifndef        CONFIG_SMP
-       sem->count += val;
-       return sem->count;
-#else
-       long ret, temp;
-       __asm__ __volatile__(
-       "1:     ldq_l   %0,%1\n"
-       "       addq    %0,%3,%2\n"
-       "       addq    %0,%3,%0\n"
-       "       stq_c   %2,%1\n"
-       "       beq     %2,2f\n"
-       ".subsection 2\n"
-       "2:     br      1b\n"
-       ".previous"
-       :"=&r" (ret), "=m" (sem->count), "=&r" (temp)
-       :"Ir" (val), "m" (sem->count));
-
-       return ret;
-#endif
-}
-
-static inline int rwsem_is_locked(struct rw_semaphore *sem)
-{
-       return (sem->count != 0);
-}
-
-#endif /* __KERNEL__ */
-#endif /* _ALPHA_RWSEM_H */
diff --git a/include/asm-alpha/scatterlist.h b/include/asm-alpha/scatterlist.h
deleted file mode 100644 (file)
index 440747c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef _ALPHA_SCATTERLIST_H
-#define _ALPHA_SCATTERLIST_H
-
-#include <asm/page.h>
-#include <asm/types.h>
-  
-struct scatterlist {
-#ifdef CONFIG_DEBUG_SG
-       unsigned long sg_magic;
-#endif
-       unsigned long page_link;
-       unsigned int offset;
-
-       unsigned int length;
-
-       dma_addr_t dma_address;
-       __u32 dma_length;
-};
-
-#define sg_dma_address(sg)     ((sg)->dma_address)
-#define sg_dma_len(sg)         ((sg)->dma_length)
-
-#define ISA_DMA_THRESHOLD (~0UL)
-
-#endif /* !(_ALPHA_SCATTERLIST_H) */
diff --git a/include/asm-alpha/sections.h b/include/asm-alpha/sections.h
deleted file mode 100644 (file)
index 43b40ed..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _ALPHA_SECTIONS_H
-#define _ALPHA_SECTIONS_H
-
-/* nothing to see, move along */
-#include <asm-generic/sections.h>
-
-#endif
diff --git a/include/asm-alpha/segment.h b/include/asm-alpha/segment.h
deleted file mode 100644 (file)
index 0453d97..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ALPHA_SEGMENT_H
-#define __ALPHA_SEGMENT_H
-
-/* Only here because we have some old header files that expect it.. */
-
-#endif
diff --git a/include/asm-alpha/sembuf.h b/include/asm-alpha/sembuf.h
deleted file mode 100644 (file)
index 7b38b15..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _ALPHA_SEMBUF_H
-#define _ALPHA_SEMBUF_H
-
-/* 
- * The semid64_ds structure for alpha architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 2 miscellaneous 64-bit values
- */
-
-struct semid64_ds {
-       struct ipc64_perm sem_perm;             /* permissions .. see ipc.h */
-       __kernel_time_t sem_otime;              /* last semop time */
-       __kernel_time_t sem_ctime;              /* last change time */
-       unsigned long   sem_nsems;              /* no. of semaphores in array */
-       unsigned long   __unused1;
-       unsigned long   __unused2;
-};
-
-#endif /* _ALPHA_SEMBUF_H */
diff --git a/include/asm-alpha/serial.h b/include/asm-alpha/serial.h
deleted file mode 100644 (file)
index 9d263e8..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * include/asm-alpha/serial.h
- */
-
-
-/*
- * This assumes you have a 1.8432 MHz clock for your UART.
- *
- * It'd be nice if someone built a serial card with a 24.576 MHz
- * clock, since the 16550A is capable of handling a top speed of 1.5
- * megabits/second; but this requires the faster clock.
- */
-#define BASE_BAUD ( 1843200 / 16 )
-
-/* Standard COM flags (except for COM4, because of the 8514 problem) */
-#ifdef CONFIG_SERIAL_DETECT_IRQ
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
-#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
-#else
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
-#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
-#endif
-
-#define SERIAL_PORT_DFNS                       \
-       /* UART CLK   PORT IRQ     FLAGS        */                      \
-       { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },      /* ttyS0 */     \
-       { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS },      /* ttyS1 */     \
-       { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS },      /* ttyS2 */     \
-       { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS },     /* ttyS3 */
diff --git a/include/asm-alpha/setup.h b/include/asm-alpha/setup.h
deleted file mode 100644 (file)
index 2e023a4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ALPHA_SETUP_H
-#define __ALPHA_SETUP_H
-
-#define COMMAND_LINE_SIZE      256
-
-#endif
diff --git a/include/asm-alpha/sfp-machine.h b/include/asm-alpha/sfp-machine.h
deleted file mode 100644 (file)
index 5fe63af..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Machine-dependent software floating-point definitions.
-   Alpha kernel version.
-   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Richard Henderson (rth@cygnus.com),
-                 Jakub Jelinek (jakub@redhat.com) and
-                 David S. Miller (davem@redhat.com).
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#ifndef _SFP_MACHINE_H
-#define _SFP_MACHINE_H
-   
-#define _FP_W_TYPE_SIZE                64
-#define _FP_W_TYPE             unsigned long
-#define _FP_WS_TYPE            signed long
-#define _FP_I_TYPE             long
-
-#define _FP_MUL_MEAT_S(R,X,Y)                                  \
-  _FP_MUL_MEAT_1_imm(_FP_WFRACBITS_S,R,X,Y)
-#define _FP_MUL_MEAT_D(R,X,Y)                                  \
-  _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_Q(R,X,Y)                                  \
-  _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
-
-#define _FP_DIV_MEAT_S(R,X,Y)  _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
-#define _FP_DIV_MEAT_D(R,X,Y)  _FP_DIV_MEAT_1_udiv(D,R,X,Y)
-#define _FP_DIV_MEAT_Q(R,X,Y)  _FP_DIV_MEAT_2_udiv(Q,R,X,Y)
-
-#define _FP_NANFRAC_S          _FP_QNANBIT_S
-#define _FP_NANFRAC_D          _FP_QNANBIT_D
-#define _FP_NANFRAC_Q          _FP_QNANBIT_Q
-#define _FP_NANSIGN_S          1
-#define _FP_NANSIGN_D          1
-#define _FP_NANSIGN_Q          1
-
-#define _FP_KEEPNANFRACP 1
-
-/* Alpha Architecture Handbook, 4.7.10.4 sais that
- * we should prefer any type of NaN in Fb, then Fa.
- */
-#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)                     \
-  do {                                                         \
-    R##_s = Y##_s;                                             \
-    _FP_FRAC_COPY_##wc(R,X);                                   \
-    R##_c = FP_CLS_NAN;                                                \
-  } while (0)
-
-/* Obtain the current rounding mode. */
-#define FP_ROUNDMODE   mode
-#define FP_RND_NEAREST (FPCR_DYN_NORMAL >> FPCR_DYN_SHIFT)
-#define FP_RND_ZERO    (FPCR_DYN_CHOPPED >> FPCR_DYN_SHIFT)
-#define FP_RND_PINF    (FPCR_DYN_PLUS >> FPCR_DYN_SHIFT)
-#define FP_RND_MINF    (FPCR_DYN_MINUS >> FPCR_DYN_SHIFT)
-
-/* Exception flags. */
-#define FP_EX_INVALID          IEEE_TRAP_ENABLE_INV
-#define FP_EX_OVERFLOW         IEEE_TRAP_ENABLE_OVF
-#define FP_EX_UNDERFLOW                IEEE_TRAP_ENABLE_UNF
-#define FP_EX_DIVZERO          IEEE_TRAP_ENABLE_DZE
-#define FP_EX_INEXACT          IEEE_TRAP_ENABLE_INE
-#define FP_EX_DENORM           IEEE_TRAP_ENABLE_DNO
-
-#define FP_DENORM_ZERO         (swcr & IEEE_MAP_DMZ)
-
-/* We write the results always */
-#define FP_INHIBIT_RESULTS 0
-
-#endif
diff --git a/include/asm-alpha/shmbuf.h b/include/asm-alpha/shmbuf.h
deleted file mode 100644 (file)
index 37ee84f..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef _ALPHA_SHMBUF_H
-#define _ALPHA_SHMBUF_H
-
-/* 
- * The shmid64_ds structure for alpha architecture.
- * Note extra padding because this structure is passed back and forth
- * between kernel and user space.
- *
- * Pad space is left for:
- * - 2 miscellaneous 64-bit values
- */
-
-struct shmid64_ds {
-       struct ipc64_perm       shm_perm;       /* operation perms */
-       size_t                  shm_segsz;      /* size of segment (bytes) */
-       __kernel_time_t         shm_atime;      /* last attach time */
-       __kernel_time_t         shm_dtime;      /* last detach time */
-       __kernel_time_t         shm_ctime;      /* last change time */
-       __kernel_pid_t          shm_cpid;       /* pid of creator */
-       __kernel_pid_t          shm_lpid;       /* pid of last operator */
-       unsigned long           shm_nattch;     /* no. of current attaches */
-       unsigned long           __unused1;
-       unsigned long           __unused2;
-};
-
-struct shminfo64 {
-       unsigned long   shmmax;
-       unsigned long   shmmin;
-       unsigned long   shmmni;
-       unsigned long   shmseg;
-       unsigned long   shmall;
-       unsigned long   __unused1;
-       unsigned long   __unused2;
-       unsigned long   __unused3;
-       unsigned long   __unused4;
-};
-
-#endif /* _ALPHA_SHMBUF_H */
diff --git a/include/asm-alpha/shmparam.h b/include/asm-alpha/shmparam.h
deleted file mode 100644 (file)
index cc901d5..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASMAXP_SHMPARAM_H
-#define _ASMAXP_SHMPARAM_H
-
-#define        SHMLBA PAGE_SIZE                 /* attach addr a multiple of this */
-
-#endif /* _ASMAXP_SHMPARAM_H */
diff --git a/include/asm-alpha/sigcontext.h b/include/asm-alpha/sigcontext.h
deleted file mode 100644 (file)
index 323cdb0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef _ASMAXP_SIGCONTEXT_H
-#define _ASMAXP_SIGCONTEXT_H
-
-struct sigcontext {
-       /*
-        * What should we have here? I'd probably better use the same
-        * stack layout as OSF/1, just in case we ever want to try
-        * running their binaries.. 
-        *
-        * This is the basic layout, but I don't know if we'll ever
-        * actually fill in all the values..
-        */
-        long           sc_onstack;
-        long           sc_mask;
-        long           sc_pc;
-        long           sc_ps;
-        long           sc_regs[32];
-        long           sc_ownedfp;
-        long           sc_fpregs[32];
-        unsigned long  sc_fpcr;
-        unsigned long  sc_fp_control;
-        unsigned long  sc_reserved1, sc_reserved2;
-        unsigned long  sc_ssize;
-        char *         sc_sbase;
-        unsigned long  sc_traparg_a0;
-        unsigned long  sc_traparg_a1;
-        unsigned long  sc_traparg_a2;
-        unsigned long  sc_fp_trap_pc;
-        unsigned long  sc_fp_trigger_sum;
-        unsigned long  sc_fp_trigger_inst;
-};
-
-
-#endif
diff --git a/include/asm-alpha/siginfo.h b/include/asm-alpha/siginfo.h
deleted file mode 100644 (file)
index 9822362..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _ALPHA_SIGINFO_H
-#define _ALPHA_SIGINFO_H
-
-#define __ARCH_SI_PREAMBLE_SIZE                (4 * sizeof(int))
-#define __ARCH_SI_TRAPNO
-
-#include <asm-generic/siginfo.h>
-
-#endif
diff --git a/include/asm-alpha/signal.h b/include/asm-alpha/signal.h
deleted file mode 100644 (file)
index 13c2305..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-#ifndef _ASMAXP_SIGNAL_H
-#define _ASMAXP_SIGNAL_H
-
-#include <linux/types.h>
-
-/* Avoid too many header ordering problems.  */
-struct siginfo;
-
-#ifdef __KERNEL__
-/* Digital Unix defines 64 signals.  Most things should be clean enough
-   to redefine this at will, if care is taken to make libc match.  */
-
-#define _NSIG          64
-#define _NSIG_BPW      64
-#define _NSIG_WORDS    (_NSIG / _NSIG_BPW)
-
-typedef unsigned long old_sigset_t;            /* at least 32 bits */
-
-typedef struct {
-       unsigned long sig[_NSIG_WORDS];
-} sigset_t;
-
-#else
-/* Here we must cater to libcs that poke about in kernel headers.  */
-
-#define NSIG           32
-typedef unsigned long sigset_t;
-
-#endif /* __KERNEL__ */
-
-
-/*
- * Linux/AXP has different signal numbers that Linux/i386: I'm trying
- * to make it OSF/1 binary compatible, at least for normal binaries.
- */
-#define SIGHUP          1
-#define SIGINT          2
-#define SIGQUIT                 3
-#define SIGILL          4
-#define SIGTRAP                 5
-#define SIGABRT                 6
-#define SIGEMT          7
-#define SIGFPE          8
-#define SIGKILL                 9
-#define SIGBUS         10
-#define SIGSEGV                11
-#define SIGSYS         12
-#define SIGPIPE                13
-#define SIGALRM                14
-#define SIGTERM                15
-#define SIGURG         16
-#define SIGSTOP                17
-#define SIGTSTP                18
-#define SIGCONT                19
-#define SIGCHLD                20
-#define SIGTTIN                21
-#define SIGTTOU                22
-#define SIGIO          23
-#define SIGXCPU                24
-#define SIGXFSZ                25
-#define SIGVTALRM      26
-#define SIGPROF                27
-#define SIGWINCH       28
-#define SIGINFO                29
-#define SIGUSR1                30
-#define SIGUSR2                31
-
-#define SIGPOLL        SIGIO
-#define SIGPWR SIGINFO
-#define SIGIOT SIGABRT
-
-/* These should not be considered constants from userland.  */
-#define SIGRTMIN       32
-#define SIGRTMAX       _NSIG
-
-/*
- * SA_FLAGS values:
- *
- * SA_ONSTACK indicates that a registered stack_t will be used.
- * SA_RESTART flag to get restarting signals (which were the default long ago)
- * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
- * SA_RESETHAND clears the handler when the signal is delivered.
- * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
- * SA_NODEFER prevents the current signal from being masked in the handler.
- *
- * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
- * Unix names RESETHAND and NODEFER respectively.
- */
-
-#define SA_ONSTACK     0x00000001
-#define SA_RESTART     0x00000002
-#define SA_NOCLDSTOP   0x00000004
-#define SA_NODEFER     0x00000008
-#define SA_RESETHAND   0x00000010
-#define SA_NOCLDWAIT   0x00000020
-#define SA_SIGINFO     0x00000040
-
-#define SA_ONESHOT     SA_RESETHAND
-#define SA_NOMASK      SA_NODEFER
-
-/* 
- * sigaltstack controls
- */
-#define SS_ONSTACK     1
-#define SS_DISABLE     2
-
-#define MINSIGSTKSZ    4096
-#define SIGSTKSZ       16384
-
-#define SIG_BLOCK          1   /* for blocking signals */
-#define SIG_UNBLOCK        2   /* for unblocking signals */
-#define SIG_SETMASK        3   /* for setting the signal mask */
-
-#include <asm-generic/signal.h>
-
-#ifdef __KERNEL__
-struct osf_sigaction {
-       __sighandler_t  sa_handler;
-       old_sigset_t    sa_mask;
-       int             sa_flags;
-};
-
-struct sigaction {
-       __sighandler_t  sa_handler;
-       unsigned long   sa_flags;
-       sigset_t        sa_mask;        /* mask last for extensibility */
-};
-
-struct k_sigaction {
-       struct sigaction sa;
-       __sigrestore_t ka_restorer;
-};
-#else
-/* Here we must cater to libcs that poke about in kernel headers.  */
-
-struct sigaction {
-       union {
-         __sighandler_t        _sa_handler;
-         void (*_sa_sigaction)(int, struct siginfo *, void *);
-       } _u;
-       sigset_t        sa_mask;
-       int             sa_flags;
-};
-
-#define sa_handler     _u._sa_handler
-#define sa_sigaction   _u._sa_sigaction
-
-#endif /* __KERNEL__ */
-
-typedef struct sigaltstack {
-       void __user *ss_sp;
-       int ss_flags;
-       size_t ss_size;
-} stack_t;
-
-/* sigstack(2) is deprecated, and will be withdrawn in a future version
-   of the X/Open CAE Specification.  Use sigaltstack instead.  It is only
-   implemented here for OSF/1 compatibility.  */
-
-struct sigstack {
-       void __user *ss_sp;
-       int ss_onstack;
-};
-
-#ifdef __KERNEL__
-#include <asm/sigcontext.h>
-
-#define ptrace_signal_deliver(regs, cookie) do { } while (0)
-
-#endif
-
-#endif
diff --git a/include/asm-alpha/smp.h b/include/asm-alpha/smp.h
deleted file mode 100644 (file)
index 544c69a..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef __ASM_SMP_H
-#define __ASM_SMP_H
-
-#include <linux/threads.h>
-#include <linux/cpumask.h>
-#include <linux/bitops.h>
-#include <asm/pal.h>
-
-/* HACK: Cabrio WHAMI return value is bogus if more than 8 bits used.. :-( */
-
-static __inline__ unsigned char
-__hard_smp_processor_id(void)
-{
-       register unsigned char __r0 __asm__("$0");
-       __asm__ __volatile__(
-               "call_pal %1 #whami"
-               : "=r"(__r0)
-               :"i" (PAL_whami)
-               : "$1", "$22", "$23", "$24", "$25");
-       return __r0;
-}
-
-#ifdef CONFIG_SMP
-
-#include <asm/irq.h>
-
-struct cpuinfo_alpha {
-       unsigned long loops_per_jiffy;
-       unsigned long last_asn;
-       int need_new_asn;
-       int asn_lock;
-       unsigned long ipi_count;
-       unsigned long prof_multiplier;
-       unsigned long prof_counter;
-       unsigned char mcheck_expected;
-       unsigned char mcheck_taken;
-       unsigned char mcheck_extra;
-} __attribute__((aligned(64)));
-
-extern struct cpuinfo_alpha cpu_data[NR_CPUS];
-
-#define PROC_CHANGE_PENALTY     20
-
-#define hard_smp_processor_id()        __hard_smp_processor_id()
-#define raw_smp_processor_id() (current_thread_info()->cpu)
-
-extern int smp_num_cpus;
-#define cpu_possible_map       cpu_present_map
-
-extern void arch_send_call_function_single_ipi(int cpu);
-extern void arch_send_call_function_ipi(cpumask_t mask);
-
-#else /* CONFIG_SMP */
-
-#define hard_smp_processor_id()                0
-#define smp_call_function_on_cpu(func,info,wait,cpu)    ({ 0; })
-
-#endif /* CONFIG_SMP */
-
-#define NO_PROC_ID     (-1)
-
-#endif
diff --git a/include/asm-alpha/socket.h b/include/asm-alpha/socket.h
deleted file mode 100644 (file)
index a1057c2..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef _ASM_SOCKET_H
-#define _ASM_SOCKET_H
-
-#include <asm/sockios.h>
-
-/* For setsockopt(2) */
-/*
- * Note: we only bother about making the SOL_SOCKET options
- * same as OSF/1, as that's all that "normal" programs are
- * likely to set.  We don't necessarily want to be binary
- * compatible with _everything_. 
- */
-#define SOL_SOCKET     0xffff
-
-#define SO_DEBUG       0x0001
-#define SO_REUSEADDR   0x0004
-#define SO_KEEPALIVE   0x0008
-#define SO_DONTROUTE   0x0010
-#define SO_BROADCAST   0x0020
-#define SO_LINGER      0x0080
-#define SO_OOBINLINE   0x0100
-/* To add :#define SO_REUSEPORT 0x0200 */
-
-#define SO_TYPE                0x1008
-#define SO_ERROR       0x1007
-#define SO_SNDBUF      0x1001
-#define SO_RCVBUF      0x1002
-#define SO_SNDBUFFORCE 0x100a
-#define SO_RCVBUFFORCE 0x100b
-#define        SO_RCVLOWAT     0x1010
-#define        SO_SNDLOWAT     0x1011
-#define        SO_RCVTIMEO     0x1012
-#define        SO_SNDTIMEO     0x1013
-#define SO_ACCEPTCONN  0x1014
-
-/* linux-specific, might as well be the same as on i386 */
-#define SO_NO_CHECK    11
-#define SO_PRIORITY    12
-#define SO_BSDCOMPAT   14
-
-#define SO_PASSCRED    17
-#define SO_PEERCRED    18
-#define SO_BINDTODEVICE 25
-
-/* Socket filtering */
-#define SO_ATTACH_FILTER        26
-#define SO_DETACH_FILTER        27
-
-#define SO_PEERNAME            28
-#define SO_TIMESTAMP           29
-#define SCM_TIMESTAMP          SO_TIMESTAMP
-
-#define SO_PEERSEC             30
-#define SO_PASSSEC             34
-#define SO_TIMESTAMPNS         35
-#define SCM_TIMESTAMPNS                SO_TIMESTAMPNS
-
-/* Security levels - as per NRL IPv6 - don't actually do anything */
-#define SO_SECURITY_AUTHENTICATION             19
-#define SO_SECURITY_ENCRYPTION_TRANSPORT       20
-#define SO_SECURITY_ENCRYPTION_NETWORK         21
-
-#define SO_MARK                        36
-
-/* O_NONBLOCK clashes with the bits used for socket types.  Therefore we
- * have to define SOCK_NONBLOCK to a different value here.
- */
-#define SOCK_NONBLOCK  0x40000000
-
-#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-alpha/sockios.h b/include/asm-alpha/sockios.h
deleted file mode 100644 (file)
index 7932c7a..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef _ASM_ALPHA_SOCKIOS_H
-#define _ASM_ALPHA_SOCKIOS_H
-
-/* Socket-level I/O control calls. */
-
-#define FIOGETOWN      _IOR('f', 123, int)
-#define FIOSETOWN      _IOW('f', 124, int)
-
-#define SIOCATMARK     _IOR('s', 7, int)
-#define SIOCSPGRP      _IOW('s', 8, pid_t)
-#define SIOCGPGRP      _IOR('s', 9, pid_t)
-
-#define SIOCGSTAMP     0x8906          /* Get stamp (timeval) */
-#define SIOCGSTAMPNS   0x8907          /* Get stamp (timespec) */
-
-#endif /* _ASM_ALPHA_SOCKIOS_H */
diff --git a/include/asm-alpha/spinlock.h b/include/asm-alpha/spinlock.h
deleted file mode 100644 (file)
index aeeb125..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-#ifndef _ALPHA_SPINLOCK_H
-#define _ALPHA_SPINLOCK_H
-
-#include <asm/system.h>
-#include <linux/kernel.h>
-#include <asm/current.h>
-
-/*
- * Simple spin lock operations.  There are two variants, one clears IRQ's
- * on the local processor, one does not.
- *
- * We make no fairness assumptions. They have a cost.
- */
-
-#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
-#define __raw_spin_is_locked(x)        ((x)->lock != 0)
-#define __raw_spin_unlock_wait(x) \
-               do { cpu_relax(); } while ((x)->lock)
-
-static inline void __raw_spin_unlock(raw_spinlock_t * lock)
-{
-       mb();
-       lock->lock = 0;
-}
-
-static inline void __raw_spin_lock(raw_spinlock_t * lock)
-{
-       long tmp;
-
-       __asm__ __volatile__(
-       "1:     ldl_l   %0,%1\n"
-       "       bne     %0,2f\n"
-       "       lda     %0,1\n"
-       "       stl_c   %0,%1\n"
-       "       beq     %0,2f\n"
-       "       mb\n"
-       ".subsection 2\n"
-       "2:     ldl     %0,%1\n"
-       "       bne     %0,2b\n"
-       "       br      1b\n"
-       ".previous"
-       : "=&r" (tmp), "=m" (lock->lock)
-       : "m"(lock->lock) : "memory");
-}
-
-static inline int __raw_spin_trylock(raw_spinlock_t *lock)
-{
-       return !test_and_set_bit(0, &lock->lock);
-}
-
-/***********************************************************/
-
-static inline int __raw_read_can_lock(raw_rwlock_t *lock)
-{
-       return (lock->lock & 1) == 0;
-}
-
-static inline int __raw_write_can_lock(raw_rwlock_t *lock)
-{
-       return lock->lock == 0;
-}
-
-static inline void __raw_read_lock(raw_rwlock_t *lock)
-{
-       long regx;
-
-       __asm__ __volatile__(
-       "1:     ldl_l   %1,%0\n"
-       "       blbs    %1,6f\n"
-       "       subl    %1,2,%1\n"
-       "       stl_c   %1,%0\n"
-       "       beq     %1,6f\n"
-       "       mb\n"
-       ".subsection 2\n"
-       "6:     ldl     %1,%0\n"
-       "       blbs    %1,6b\n"
-       "       br      1b\n"
-       ".previous"
-       : "=m" (*lock), "=&r" (regx)
-       : "m" (*lock) : "memory");
-}
-
-static inline void __raw_write_lock(raw_rwlock_t *lock)
-{
-       long regx;
-
-       __asm__ __volatile__(
-       "1:     ldl_l   %1,%0\n"
-       "       bne     %1,6f\n"
-       "       lda     %1,1\n"
-       "       stl_c   %1,%0\n"
-       "       beq     %1,6f\n"
-       "       mb\n"
-       ".subsection 2\n"
-       "6:     ldl     %1,%0\n"
-       "       bne     %1,6b\n"
-       "       br      1b\n"
-       ".previous"
-       : "=m" (*lock), "=&r" (regx)
-       : "m" (*lock) : "memory");
-}
-
-static inline int __raw_read_trylock(raw_rwlock_t * lock)
-{
-       long regx;
-       int success;
-
-       __asm__ __volatile__(
-       "1:     ldl_l   %1,%0\n"
-       "       lda     %2,0\n"
-       "       blbs    %1,2f\n"
-       "       subl    %1,2,%2\n"
-       "       stl_c   %2,%0\n"
-       "       beq     %2,6f\n"
-       "2:     mb\n"
-       ".subsection 2\n"
-       "6:     br      1b\n"
-       ".previous"
-       : "=m" (*lock), "=&r" (regx), "=&r" (success)
-       : "m" (*lock) : "memory");
-
-       return success;
-}
-
-static inline int __raw_write_trylock(raw_rwlock_t * lock)
-{
-       long regx;
-       int success;
-
-       __asm__ __volatile__(
-       "1:     ldl_l   %1,%0\n"
-       "       lda     %2,0\n"
-       "       bne     %1,2f\n"
-       "       lda     %2,1\n"
-       "       stl_c   %2,%0\n"
-       "       beq     %2,6f\n"
-       "2:     mb\n"
-       ".subsection 2\n"
-       "6:     br      1b\n"
-       ".previous"
-       : "=m" (*lock), "=&r" (regx), "=&r" (success)
-       : "m" (*lock) : "memory");
-
-       return success;
-}
-
-static inline void __raw_read_unlock(raw_rwlock_t * lock)
-{
-       long regx;
-       __asm__ __volatile__(
-       "       mb\n"
-       "1:     ldl_l   %1,%0\n"
-       "       addl    %1,2,%1\n"
-       "       stl_c   %1,%0\n"
-       "       beq     %1,6f\n"
-       ".subsection 2\n"
-       "6:     br      1b\n"
-       ".previous"
-       : "=m" (*lock), "=&r" (regx)
-       : "m" (*lock) : "memory");
-}
-
-static inline void __raw_write_unlock(raw_rwlock_t * lock)
-{
-       mb();
-       lock->lock = 0;
-}
-
-#define _raw_spin_relax(lock)  cpu_relax()
-#define _raw_read_relax(lock)  cpu_relax()
-#define _raw_write_relax(lock) cpu_relax()
-
-#endif /* _ALPHA_SPINLOCK_H */
diff --git a/include/asm-alpha/spinlock_types.h b/include/asm-alpha/spinlock_types.h
deleted file mode 100644 (file)
index 8141eb5..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef _ALPHA_SPINLOCK_TYPES_H
-#define _ALPHA_SPINLOCK_TYPES_H
-
-#ifndef __LINUX_SPINLOCK_TYPES_H
-# error "please don't include this file directly"
-#endif
-
-typedef struct {
-       volatile unsigned int lock;
-} raw_spinlock_t;
-
-#define __RAW_SPIN_LOCK_UNLOCKED       { 0 }
-
-typedef struct {
-       volatile unsigned int lock;
-} raw_rwlock_t;
-
-#define __RAW_RW_LOCK_UNLOCKED         { 0 }
-
-#endif
diff --git a/include/asm-alpha/stat.h b/include/asm-alpha/stat.h
deleted file mode 100644 (file)
index 07ad3e6..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef _ALPHA_STAT_H
-#define _ALPHA_STAT_H
-
-struct stat {
-       unsigned int    st_dev;
-       unsigned int    st_ino;
-       unsigned int    st_mode;
-       unsigned int    st_nlink;
-       unsigned int    st_uid;
-       unsigned int    st_gid;
-       unsigned int    st_rdev;
-       long            st_size;
-       unsigned long   st_atime;
-       unsigned long   st_mtime;
-       unsigned long   st_ctime;
-       unsigned int    st_blksize;
-       unsigned int    st_blocks;
-       unsigned int    st_flags;
-       unsigned int    st_gen;
-};
-
-/* The stat64 structure increases the size of dev_t, blkcnt_t, adds
-   nanosecond resolution times, and padding for expansion.  */
-
-struct stat64 {
-       unsigned long   st_dev;
-       unsigned long   st_ino;
-       unsigned long   st_rdev;
-       long            st_size;
-       unsigned long   st_blocks;
-
-       unsigned int    st_mode;
-       unsigned int    st_uid;
-       unsigned int    st_gid;
-       unsigned int    st_blksize;
-       unsigned int    st_nlink;
-       unsigned int    __pad0;
-
-       unsigned long   st_atime;
-       unsigned long   st_atime_nsec; 
-       unsigned long   st_mtime;
-       unsigned long   st_mtime_nsec;
-       unsigned long   st_ctime;
-       unsigned long   st_ctime_nsec;
-       long            __unused[3];
-};
-
-#endif
diff --git a/include/asm-alpha/statfs.h b/include/asm-alpha/statfs.h
deleted file mode 100644 (file)
index ad15830..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ALPHA_STATFS_H
-#define _ALPHA_STATFS_H
-
-#include <asm-generic/statfs.h>
-
-#endif
diff --git a/include/asm-alpha/string.h b/include/asm-alpha/string.h
deleted file mode 100644 (file)
index b02b8a2..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef __ALPHA_STRING_H__
-#define __ALPHA_STRING_H__
-
-#ifdef __KERNEL__
-
-/*
- * GCC of any recent vintage doesn't do stupid things with bcopy.
- * EGCS 1.1 knows all about expanding memcpy inline, others don't.
- *
- * Similarly for a memset with data = 0.
- */
-
-#define __HAVE_ARCH_MEMCPY
-extern void * memcpy(void *, const void *, size_t);
-#define __HAVE_ARCH_MEMMOVE
-extern void * memmove(void *, const void *, size_t);
-
-/* For backward compatibility with modules.  Unused otherwise.  */
-extern void * __memcpy(void *, const void *, size_t);
-
-#define memcpy __builtin_memcpy
-
-#define __HAVE_ARCH_MEMSET
-extern void * __constant_c_memset(void *, unsigned long, size_t);
-extern void * __memset(void *, int, size_t);
-extern void * memset(void *, int, size_t);
-
-#define memset(s, c, n)                                                            \
-(__builtin_constant_p(c)                                                   \
- ? (__builtin_constant_p(n) && (c) == 0                                            \
-    ? __builtin_memset((s),0,(n))                                          \
-    : __constant_c_memset((s),0x0101010101010101UL*(unsigned char)(c),(n))) \
- : __memset((s),(c),(n)))
-
-#define __HAVE_ARCH_STRCPY
-extern char * strcpy(char *,const char *);
-#define __HAVE_ARCH_STRNCPY
-extern char * strncpy(char *, const char *, size_t);
-#define __HAVE_ARCH_STRCAT
-extern char * strcat(char *, const char *);
-#define __HAVE_ARCH_STRNCAT
-extern char * strncat(char *, const char *, size_t);
-#define __HAVE_ARCH_STRCHR
-extern char * strchr(const char *,int);
-#define __HAVE_ARCH_STRRCHR
-extern char * strrchr(const char *,int);
-#define __HAVE_ARCH_STRLEN
-extern size_t strlen(const char *);
-#define __HAVE_ARCH_MEMCHR
-extern void * memchr(const void *, int, size_t);
-
-/* The following routine is like memset except that it writes 16-bit
-   aligned values.  The DEST and COUNT parameters must be even for 
-   correct operation.  */
-
-#define __HAVE_ARCH_MEMSETW
-extern void * __memsetw(void *dest, unsigned short, size_t count);
-
-#define memsetw(s, c, n)                                                \
-(__builtin_constant_p(c)                                                \
- ? __constant_c_memset((s),0x0001000100010001UL*(unsigned short)(c),(n)) \
- : __memsetw((s),(c),(n)))
-
-#endif /* __KERNEL__ */
-
-#endif /* __ALPHA_STRING_H__ */
diff --git a/include/asm-alpha/suspend.h b/include/asm-alpha/suspend.h
deleted file mode 100644 (file)
index c7042d5..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __ALPHA_SUSPEND_H
-#define __ALPHA_SUSPEND_H
-
-/* Dummy include. */
-
-#endif  /* __ALPHA_SUSPEND_H */
diff --git a/include/asm-alpha/sysinfo.h b/include/asm-alpha/sysinfo.h
deleted file mode 100644 (file)
index 086aba2..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * include/asm-alpha/sysinfo.h
- */
-
-#ifndef __ASM_ALPHA_SYSINFO_H
-#define __ASM_ALPHA_SYSINFO_H
-
-/* This defines the subset of the OSF/1 getsysinfo/setsysinfo calls
-   that we support.  */
-
-#define GSI_UACPROC                    8
-#define GSI_IEEE_FP_CONTROL            45
-#define GSI_IEEE_STATE_AT_SIGNAL       46
-#define GSI_PROC_TYPE                  60
-#define GSI_GET_HWRPB                  101
-
-#define SSI_NVPAIRS                    1
-#define SSI_IEEE_FP_CONTROL            14
-#define SSI_IEEE_STATE_AT_SIGNAL       15
-#define SSI_IEEE_IGNORE_STATE_AT_SIGNAL        16
-#define SSI_IEEE_RAISE_EXCEPTION       1001    /* linux specific */
-
-#define SSIN_UACPROC                   6
-
-#define UAC_BITMASK                    7
-#define UAC_NOPRINT                    1
-#define UAC_NOFIX                      2
-#define UAC_SIGBUS                     4
-
-
-#ifdef __KERNEL__
-
-/* This is the shift that is applied to the UAC bits as stored in the
-   per-thread flags.  See thread_info.h.  */
-#define UAC_SHIFT                      6
-
-#endif
-
-#endif /* __ASM_ALPHA_SYSINFO_H */
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h
deleted file mode 100644 (file)
index afe20fa..0000000
+++ /dev/null
@@ -1,829 +0,0 @@
-#ifndef __ALPHA_SYSTEM_H
-#define __ALPHA_SYSTEM_H
-
-#include <asm/pal.h>
-#include <asm/page.h>
-#include <asm/barrier.h>
-
-/*
- * System defines.. Note that this is included both from .c and .S
- * files, so it does only defines, not any C code.
- */
-
-/*
- * We leave one page for the initial stack page, and one page for
- * the initial process structure. Also, the console eats 3 MB for
- * the initial bootloader (one of which we can reclaim later).
- */
-#define BOOT_PCB       0x20000000
-#define BOOT_ADDR      0x20000000
-/* Remove when official MILO sources have ELF support: */
-#define BOOT_SIZE      (16*1024)
-
-#ifdef CONFIG_ALPHA_LEGACY_START_ADDRESS
-#define KERNEL_START_PHYS      0x300000 /* Old bootloaders hardcoded this.  */
-#else
-#define KERNEL_START_PHYS      0x1000000 /* required: Wildfire/Titan/Marvel */
-#endif
-
-#define KERNEL_START   (PAGE_OFFSET+KERNEL_START_PHYS)
-#define SWAPPER_PGD    KERNEL_START
-#define INIT_STACK     (PAGE_OFFSET+KERNEL_START_PHYS+0x02000)
-#define EMPTY_PGT      (PAGE_OFFSET+KERNEL_START_PHYS+0x04000)
-#define EMPTY_PGE      (PAGE_OFFSET+KERNEL_START_PHYS+0x08000)
-#define ZERO_PGE       (PAGE_OFFSET+KERNEL_START_PHYS+0x0A000)
-
-#define START_ADDR     (PAGE_OFFSET+KERNEL_START_PHYS+0x10000)
-
-/*
- * This is setup by the secondary bootstrap loader.  Because
- * the zero page is zeroed out as soon as the vm system is
- * initialized, we need to copy things out into a more permanent
- * place.
- */
-#define PARAM                  ZERO_PGE
-#define COMMAND_LINE           ((char*)(PARAM + 0x0000))
-#define INITRD_START           (*(unsigned long *) (PARAM+0x100))
-#define INITRD_SIZE            (*(unsigned long *) (PARAM+0x108))
-
-#ifndef __ASSEMBLY__
-#include <linux/kernel.h>
-#define AT_VECTOR_SIZE_ARCH 4 /* entries in ARCH_DLINFO */
-
-/*
- * This is the logout header that should be common to all platforms
- * (assuming they are running OSF/1 PALcode, I guess).
- */
-struct el_common {
-       unsigned int    size;           /* size in bytes of logout area */
-       unsigned int    sbz1    : 30;   /* should be zero */
-       unsigned int    err2    :  1;   /* second error */
-       unsigned int    retry   :  1;   /* retry flag */
-       unsigned int    proc_offset;    /* processor-specific offset */
-       unsigned int    sys_offset;     /* system-specific offset */
-       unsigned int    code;           /* machine check code */
-       unsigned int    frame_rev;      /* frame revision */
-};
-
-/* Machine Check Frame for uncorrectable errors (Large format)
- *      --- This is used to log uncorrectable errors such as
- *          double bit ECC errors.
- *      --- These errors are detected by both processor and systems.
- */
-struct el_common_EV5_uncorrectable_mcheck {
-        unsigned long   shadow[8];        /* Shadow reg. 8-14, 25           */
-        unsigned long   paltemp[24];      /* PAL TEMP REGS.                 */
-        unsigned long   exc_addr;         /* Address of excepting instruction*/
-        unsigned long   exc_sum;          /* Summary of arithmetic traps.   */
-        unsigned long   exc_mask;         /* Exception mask (from exc_sum). */
-        unsigned long   pal_base;         /* Base address for PALcode.      */
-        unsigned long   isr;              /* Interrupt Status Reg.          */
-        unsigned long   icsr;             /* CURRENT SETUP OF EV5 IBOX      */
-        unsigned long   ic_perr_stat;     /* I-CACHE Reg. <11> set Data parity
-                                                         <12> set TAG parity*/
-        unsigned long   dc_perr_stat;     /* D-CACHE error Reg. Bits set to 1:
-                                                     <2> Data error in bank 0
-                                                     <3> Data error in bank 1
-                                                     <4> Tag error in bank 0
-                                                     <5> Tag error in bank 1 */
-        unsigned long   va;               /* Effective VA of fault or miss. */
-        unsigned long   mm_stat;          /* Holds the reason for D-stream 
-                                             fault or D-cache parity errors */
-        unsigned long   sc_addr;          /* Address that was being accessed
-                                             when EV5 detected Secondary cache
-                                             failure.                 */
-        unsigned long   sc_stat;          /* Helps determine if the error was
-                                             TAG/Data parity(Secondary Cache)*/
-        unsigned long   bc_tag_addr;      /* Contents of EV5 BC_TAG_ADDR    */
-        unsigned long   ei_addr;          /* Physical address of any transfer
-                                             that is logged in EV5 EI_STAT */
-        unsigned long   fill_syndrome;    /* For correcting ECC errors.     */
-        unsigned long   ei_stat;          /* Helps identify reason of any 
-                                             processor uncorrectable error
-                                             at its external interface.     */
-        unsigned long   ld_lock;          /* Contents of EV5 LD_LOCK register*/
-};
-
-struct el_common_EV6_mcheck {
-       unsigned int FrameSize;         /* Bytes, including this field */
-       unsigned int FrameFlags;        /* <31> = Retry, <30> = Second Error */
-       unsigned int CpuOffset;         /* Offset to CPU-specific info */
-       unsigned int SystemOffset;      /* Offset to system-specific info */
-       unsigned int MCHK_Code;
-       unsigned int MCHK_Frame_Rev;
-       unsigned long I_STAT;           /* EV6 Internal Processor Registers */
-       unsigned long DC_STAT;          /* (See the 21264 Spec) */
-       unsigned long C_ADDR;
-       unsigned long DC1_SYNDROME;
-       unsigned long DC0_SYNDROME;
-       unsigned long C_STAT;
-       unsigned long C_STS;
-       unsigned long MM_STAT;
-       unsigned long EXC_ADDR;
-       unsigned long IER_CM;
-       unsigned long ISUM;
-       unsigned long RESERVED0;
-       unsigned long PAL_BASE;
-       unsigned long I_CTL;
-       unsigned long PCTX;
-};
-
-extern void halt(void) __attribute__((noreturn));
-#define __halt() __asm__ __volatile__ ("call_pal %0 #halt" : : "i" (PAL_halt))
-
-#define switch_to(P,N,L)                                                \
-  do {                                                                  \
-    (L) = alpha_switch_to(virt_to_phys(&task_thread_info(N)->pcb), (P)); \
-    check_mmu_context();                                                \
-  } while (0)
-
-struct task_struct;
-extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*);
-
-#define imb() \
-__asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory")
-
-#define draina() \
-__asm__ __volatile__ ("call_pal %0 #draina" : : "i" (PAL_draina) : "memory")
-
-enum implver_enum {
-       IMPLVER_EV4,
-       IMPLVER_EV5,
-       IMPLVER_EV6
-};
-
-#ifdef CONFIG_ALPHA_GENERIC
-#define implver()                              \
-({ unsigned long __implver;                    \
-   __asm__ ("implver %0" : "=r"(__implver));   \
-   (enum implver_enum) __implver; })
-#else
-/* Try to eliminate some dead code.  */
-#ifdef CONFIG_ALPHA_EV4
-#define implver() IMPLVER_EV4
-#endif
-#ifdef CONFIG_ALPHA_EV5
-#define implver() IMPLVER_EV5
-#endif
-#if defined(CONFIG_ALPHA_EV6)
-#define implver() IMPLVER_EV6
-#endif
-#endif
-
-enum amask_enum {
-       AMASK_BWX = (1UL << 0),
-       AMASK_FIX = (1UL << 1),
-       AMASK_CIX = (1UL << 2),
-       AMASK_MAX = (1UL << 8),
-       AMASK_PRECISE_TRAP = (1UL << 9),
-};
-
-#define amask(mask)                                            \
-({ unsigned long __amask, __input = (mask);                    \
-   __asm__ ("amask %1,%0" : "=r"(__amask) : "rI"(__input));    \
-   __amask; })
-
-#define __CALL_PAL_R0(NAME, TYPE)                              \
-extern inline TYPE NAME(void)                                  \
-{                                                              \
-       register TYPE __r0 __asm__("$0");                       \
-       __asm__ __volatile__(                                   \
-               "call_pal %1 # " #NAME                          \
-               :"=r" (__r0)                                    \
-               :"i" (PAL_ ## NAME)                             \
-               :"$1", "$16", "$22", "$23", "$24", "$25");      \
-       return __r0;                                            \
-}
-
-#define __CALL_PAL_W1(NAME, TYPE0)                             \
-extern inline void NAME(TYPE0 arg0)                            \
-{                                                              \
-       register TYPE0 __r16 __asm__("$16") = arg0;             \
-       __asm__ __volatile__(                                   \
-               "call_pal %1 # "#NAME                           \
-               : "=r"(__r16)                                   \
-               : "i"(PAL_ ## NAME), "0"(__r16)                 \
-               : "$1", "$22", "$23", "$24", "$25");            \
-}
-
-#define __CALL_PAL_W2(NAME, TYPE0, TYPE1)                      \
-extern inline void NAME(TYPE0 arg0, TYPE1 arg1)                        \
-{                                                              \
-       register TYPE0 __r16 __asm__("$16") = arg0;             \
-       register TYPE1 __r17 __asm__("$17") = arg1;             \
-       __asm__ __volatile__(                                   \
-               "call_pal %2 # "#NAME                           \
-               : "=r"(__r16), "=r"(__r17)                      \
-               : "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17)     \
-               : "$1", "$22", "$23", "$24", "$25");            \
-}
-
-#define __CALL_PAL_RW1(NAME, RTYPE, TYPE0)                     \
-extern inline RTYPE NAME(TYPE0 arg0)                           \
-{                                                              \
-       register RTYPE __r0 __asm__("$0");                      \
-       register TYPE0 __r16 __asm__("$16") = arg0;             \
-       __asm__ __volatile__(                                   \
-               "call_pal %2 # "#NAME                           \
-               : "=r"(__r16), "=r"(__r0)                       \
-               : "i"(PAL_ ## NAME), "0"(__r16)                 \
-               : "$1", "$22", "$23", "$24", "$25");            \
-       return __r0;                                            \
-}
-
-#define __CALL_PAL_RW2(NAME, RTYPE, TYPE0, TYPE1)              \
-extern inline RTYPE NAME(TYPE0 arg0, TYPE1 arg1)               \
-{                                                              \
-       register RTYPE __r0 __asm__("$0");                      \
-       register TYPE0 __r16 __asm__("$16") = arg0;             \
-       register TYPE1 __r17 __asm__("$17") = arg1;             \
-       __asm__ __volatile__(                                   \
-               "call_pal %3 # "#NAME                           \
-               : "=r"(__r16), "=r"(__r17), "=r"(__r0)          \
-               : "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17)     \
-               : "$1", "$22", "$23", "$24", "$25");            \
-       return __r0;                                            \
-}
-
-__CALL_PAL_W1(cflush, unsigned long);
-__CALL_PAL_R0(rdmces, unsigned long);
-__CALL_PAL_R0(rdps, unsigned long);
-__CALL_PAL_R0(rdusp, unsigned long);
-__CALL_PAL_RW1(swpipl, unsigned long, unsigned long);
-__CALL_PAL_R0(whami, unsigned long);
-__CALL_PAL_W2(wrent, void*, unsigned long);
-__CALL_PAL_W1(wripir, unsigned long);
-__CALL_PAL_W1(wrkgp, unsigned long);
-__CALL_PAL_W1(wrmces, unsigned long);
-__CALL_PAL_RW2(wrperfmon, unsigned long, unsigned long, unsigned long);
-__CALL_PAL_W1(wrusp, unsigned long);
-__CALL_PAL_W1(wrvptptr, unsigned long);
-
-#define IPL_MIN                0
-#define IPL_SW0                1
-#define IPL_SW1                2
-#define IPL_DEV0       3
-#define IPL_DEV1       4
-#define IPL_TIMER      5
-#define IPL_PERF       6
-#define IPL_POWERFAIL  6
-#define IPL_MCHECK     7
-#define IPL_MAX                7
-
-#ifdef CONFIG_ALPHA_BROKEN_IRQ_MASK
-#undef IPL_MIN
-#define IPL_MIN                __min_ipl
-extern int __min_ipl;
-#endif
-
-#define getipl()               (rdps() & 7)
-#define setipl(ipl)            ((void) swpipl(ipl))
-
-#define local_irq_disable()                    do { setipl(IPL_MAX); barrier(); } while(0)
-#define local_irq_enable()                     do { barrier(); setipl(IPL_MIN); } while(0)
-#define local_save_flags(flags)        ((flags) = rdps())
-#define local_irq_save(flags)  do { (flags) = swpipl(IPL_MAX); barrier(); } while(0)
-#define local_irq_restore(flags)       do { barrier(); setipl(flags); barrier(); } while(0)
-
-#define irqs_disabled()        (getipl() == IPL_MAX)
-
-/*
- * TB routines..
- */
-#define __tbi(nr,arg,arg1...)                                  \
-({                                                             \
-       register unsigned long __r16 __asm__("$16") = (nr);     \
-       register unsigned long __r17 __asm__("$17"); arg;       \
-       __asm__ __volatile__(                                   \
-               "call_pal %3 #__tbi"                            \
-               :"=r" (__r16),"=r" (__r17)                      \
-               :"0" (__r16),"i" (PAL_tbi) ,##arg1              \
-               :"$0", "$1", "$22", "$23", "$24", "$25");       \
-})
-
-#define tbi(x,y)       __tbi(x,__r17=(y),"1" (__r17))
-#define tbisi(x)       __tbi(1,__r17=(x),"1" (__r17))
-#define tbisd(x)       __tbi(2,__r17=(x),"1" (__r17))
-#define tbis(x)                __tbi(3,__r17=(x),"1" (__r17))
-#define tbiap()                __tbi(-1, /* no second argument */)
-#define tbia()         __tbi(-2, /* no second argument */)
-
-/*
- * Atomic exchange.
- * Since it can be used to implement critical sections
- * it must clobber "memory" (also for interrupts in UP).
- */
-
-static inline unsigned long
-__xchg_u8(volatile char *m, unsigned long val)
-{
-       unsigned long ret, tmp, addr64;
-
-       __asm__ __volatile__(
-       "       andnot  %4,7,%3\n"
-       "       insbl   %1,%4,%1\n"
-       "1:     ldq_l   %2,0(%3)\n"
-       "       extbl   %2,%4,%0\n"
-       "       mskbl   %2,%4,%2\n"
-       "       or      %1,%2,%2\n"
-       "       stq_c   %2,0(%3)\n"
-       "       beq     %2,2f\n"
-#ifdef CONFIG_SMP
-       "       mb\n"
-#endif
-       ".subsection 2\n"
-       "2:     br      1b\n"
-       ".previous"
-       : "=&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (addr64)
-       : "r" ((long)m), "1" (val) : "memory");
-
-       return ret;
-}
-
-static inline unsigned long
-__xchg_u16(volatile short *m, unsigned long val)
-{
-       unsigned long ret, tmp, addr64;
-
-       __asm__ __volatile__(
-       "       andnot  %4,7,%3\n"
-       "       inswl   %1,%4,%1\n"
-       "1:     ldq_l   %2,0(%3)\n"
-       "       extwl   %2,%4,%0\n"
-       "       mskwl   %2,%4,%2\n"
-       "       or      %1,%2,%2\n"
-       "       stq_c   %2,0(%3)\n"
-       "       beq     %2,2f\n"
-#ifdef CONFIG_SMP
-       "       mb\n"
-#endif
-       ".subsection 2\n"
-       "2:     br      1b\n"
-       ".previous"
-       : "=&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (addr64)
-       : "r" ((long)m), "1" (val) : "memory");
-
-       return ret;
-}
-
-static inline unsigned long
-__xchg_u32(volatile int *m, unsigned long val)
-{
-       unsigned long dummy;
-
-       __asm__ __volatile__(
-       "1:     ldl_l %0,%4\n"
-       "       bis $31,%3,%1\n"
-       "       stl_c %1,%2\n"
-       "       beq %1,2f\n"
-#ifdef CONFIG_SMP
-       "       mb\n"
-#endif
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       : "=&r" (val), "=&r" (dummy), "=m" (*m)
-       : "rI" (val), "m" (*m) : "memory");
-
-       return val;
-}
-
-static inline unsigned long
-__xchg_u64(volatile long *m, unsigned long val)
-{
-       unsigned long dummy;
-
-       __asm__ __volatile__(
-       "1:     ldq_l %0,%4\n"
-       "       bis $31,%3,%1\n"
-       "       stq_c %1,%2\n"
-       "       beq %1,2f\n"
-#ifdef CONFIG_SMP
-       "       mb\n"
-#endif
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       : "=&r" (val), "=&r" (dummy), "=m" (*m)
-       : "rI" (val), "m" (*m) : "memory");
-
-       return val;
-}
-
-/* This function doesn't exist, so you'll get a linker error
-   if something tries to do an invalid xchg().  */
-extern void __xchg_called_with_bad_pointer(void);
-
-#define __xchg(ptr, x, size) \
-({ \
-       unsigned long __xchg__res; \
-       volatile void *__xchg__ptr = (ptr); \
-       switch (size) { \
-               case 1: __xchg__res = __xchg_u8(__xchg__ptr, x); break; \
-               case 2: __xchg__res = __xchg_u16(__xchg__ptr, x); break; \
-               case 4: __xchg__res = __xchg_u32(__xchg__ptr, x); break; \
-               case 8: __xchg__res = __xchg_u64(__xchg__ptr, x); break; \
-               default: __xchg_called_with_bad_pointer(); __xchg__res = x; \
-       } \
-       __xchg__res; \
-})
-
-#define xchg(ptr,x)                                                         \
-  ({                                                                        \
-     __typeof__(*(ptr)) _x_ = (x);                                          \
-     (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, sizeof(*(ptr))); \
-  })
-
-static inline unsigned long
-__xchg_u8_local(volatile char *m, unsigned long val)
-{
-       unsigned long ret, tmp, addr64;
-
-       __asm__ __volatile__(
-       "       andnot  %4,7,%3\n"
-       "       insbl   %1,%4,%1\n"
-       "1:     ldq_l   %2,0(%3)\n"
-       "       extbl   %2,%4,%0\n"
-       "       mskbl   %2,%4,%2\n"
-       "       or      %1,%2,%2\n"
-       "       stq_c   %2,0(%3)\n"
-       "       beq     %2,2f\n"
-       ".subsection 2\n"
-       "2:     br      1b\n"
-       ".previous"
-       : "=&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (addr64)
-       : "r" ((long)m), "1" (val) : "memory");
-
-       return ret;
-}
-
-static inline unsigned long
-__xchg_u16_local(volatile short *m, unsigned long val)
-{
-       unsigned long ret, tmp, addr64;
-
-       __asm__ __volatile__(
-       "       andnot  %4,7,%3\n"
-       "       inswl   %1,%4,%1\n"
-       "1:     ldq_l   %2,0(%3)\n"
-       "       extwl   %2,%4,%0\n"
-       "       mskwl   %2,%4,%2\n"
-       "       or      %1,%2,%2\n"
-       "       stq_c   %2,0(%3)\n"
-       "       beq     %2,2f\n"
-       ".subsection 2\n"
-       "2:     br      1b\n"
-       ".previous"
-       : "=&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (addr64)
-       : "r" ((long)m), "1" (val) : "memory");
-
-       return ret;
-}
-
-static inline unsigned long
-__xchg_u32_local(volatile int *m, unsigned long val)
-{
-       unsigned long dummy;
-
-       __asm__ __volatile__(
-       "1:     ldl_l %0,%4\n"
-       "       bis $31,%3,%1\n"
-       "       stl_c %1,%2\n"
-       "       beq %1,2f\n"
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       : "=&r" (val), "=&r" (dummy), "=m" (*m)
-       : "rI" (val), "m" (*m) : "memory");
-
-       return val;
-}
-
-static inline unsigned long
-__xchg_u64_local(volatile long *m, unsigned long val)
-{
-       unsigned long dummy;
-
-       __asm__ __volatile__(
-       "1:     ldq_l %0,%4\n"
-       "       bis $31,%3,%1\n"
-       "       stq_c %1,%2\n"
-       "       beq %1,2f\n"
-       ".subsection 2\n"
-       "2:     br 1b\n"
-       ".previous"
-       : "=&r" (val), "=&r" (dummy), "=m" (*m)
-       : "rI" (val), "m" (*m) : "memory");
-
-       return val;
-}
-
-#define __xchg_local(ptr, x, size) \
-({ \
-       unsigned long __xchg__res; \
-       volatile void *__xchg__ptr = (ptr); \
-       switch (size) { \
-               case 1: __xchg__res = __xchg_u8_local(__xchg__ptr, x); break; \
-               case 2: __xchg__res = __xchg_u16_local(__xchg__ptr, x); break; \
-               case 4: __xchg__res = __xchg_u32_local(__xchg__ptr, x); break; \
-               case 8: __xchg__res = __xchg_u64_local(__xchg__ptr, x); break; \
-               default: __xchg_called_with_bad_pointer(); __xchg__res = x; \
-       } \
-       __xchg__res; \
-})
-
-#define xchg_local(ptr,x)                                                   \
-  ({                                                                        \
-     __typeof__(*(ptr)) _x_ = (x);                                          \
-     (__typeof__(*(ptr))) __xchg_local((ptr), (unsigned long)_x_,           \
-               sizeof(*(ptr))); \
-  })
-
-/* 
- * Atomic compare and exchange.  Compare OLD with MEM, if identical,
- * store NEW in MEM.  Return the initial value in MEM.  Success is
- * indicated by comparing RETURN with OLD.
- *
- * The memory barrier should be placed in SMP only when we actually
- * make the change. If we don't change anything (so if the returned
- * prev is equal to old) then we aren't acquiring anything new and
- * we don't need any memory barrier as far I can tell.
- */
-
-#define __HAVE_ARCH_CMPXCHG 1
-
-static inline unsigned long
-__cmpxchg_u8(volatile char *m, long old, long new)
-{
-       unsigned long prev, tmp, cmp, addr64;
-
-       __asm__ __volatile__(
-       "       andnot  %5,7,%4\n"
-       "       insbl   %1,%5,%1\n"
-       "1:     ldq_l   %2,0(%4)\n"
-       "       extbl   %2,%5,%0\n"
-       "       cmpeq   %0,%6,%3\n"
-       "       beq     %3,2f\n"
-       "       mskbl   %2,%5,%2\n"
-       "       or      %1,%2,%2\n"
-       "       stq_c   %2,0(%4)\n"
-       "       beq     %2,3f\n"
-#ifdef CONFIG_SMP
-       "       mb\n"
-#endif
-       "2:\n"
-       ".subsection 2\n"
-       "3:     br      1b\n"
-       ".previous"
-       : "=&r" (prev), "=&r" (new), "=&r" (tmp), "=&r" (cmp), "=&r" (addr64)
-       : "r" ((long)m), "Ir" (old), "1" (new) : "memory");
-
-       return prev;
-}
-
-static inline unsigned long
-__cmpxchg_u16(volatile short *m, long old, long new)
-{
-       unsigned long prev, tmp, cmp, addr64;
-
-       __asm__ __volatile__(
-       "       andnot  %5,7,%4\n"
-       "       inswl   %1,%5,%1\n"
-       "1:     ldq_l   %2,0(%4)\n"
-       "       extwl   %2,%5,%0\n"
-       "       cmpeq   %0,%6,%3\n"
-       "       beq     %3,2f\n"
-       "       mskwl   %2,%5,%2\n"
-       "       or      %1,%2,%2\n"
-       "       stq_c   %2,0(%4)\n"
-       "       beq     %2,3f\n"
-#ifdef CONFIG_SMP
-       "       mb\n"
-#endif
-       "2:\n"
-       ".subsection 2\n"
-       "3:     br      1b\n"
-       ".previous"
-       : "=&r" (prev), "=&r" (new), "=&r" (tmp), "=&r" (cmp), "=&r" (addr64)
-       : "r" ((long)m), "Ir" (old), "1" (new) : "memory");
-
-       return prev;
-}
-
-static inline unsigned long
-__cmpxchg_u32(volatile int *m, int old, int new)
-{
-       unsigned long prev, cmp;
-
-       __asm__ __volatile__(
-       "1:     ldl_l %0,%5\n"
-       "       cmpeq %0,%3,%1\n"
-       "       beq %1,2f\n"
-       "       mov %4,%1\n"
-       "       stl_c %1,%2\n"
-       "       beq %1,3f\n"
-#ifdef CONFIG_SMP
-       "       mb\n"
-#endif
-       "2:\n"
-       ".subsection 2\n"
-       "3:     br 1b\n"
-       ".previous"
-       : "=&r"(prev), "=&r"(cmp), "=m"(*m)
-       : "r"((long) old), "r"(new), "m"(*m) : "memory");
-
-       return prev;
-}
-
-static inline unsigned long
-__cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
-{
-       unsigned long prev, cmp;
-
-       __asm__ __volatile__(
-       "1:     ldq_l %0,%5\n"
-       "       cmpeq %0,%3,%1\n"
-       "       beq %1,2f\n"
-       "       mov %4,%1\n"
-       "       stq_c %1,%2\n"
-       "       beq %1,3f\n"
-#ifdef CONFIG_SMP
-       "       mb\n"
-#endif
-       "2:\n"
-       ".subsection 2\n"
-       "3:     br 1b\n"
-       ".previous"
-       : "=&r"(prev), "=&r"(cmp), "=m"(*m)
-       : "r"((long) old), "r"(new), "m"(*m) : "memory");
-
-       return prev;
-}
-
-/* This function doesn't exist, so you'll get a linker error
-   if something tries to do an invalid cmpxchg().  */
-extern void __cmpxchg_called_with_bad_pointer(void);
-
-static __always_inline unsigned long
-__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
-{
-       switch (size) {
-               case 1:
-                       return __cmpxchg_u8(ptr, old, new);
-               case 2:
-                       return __cmpxchg_u16(ptr, old, new);
-               case 4:
-                       return __cmpxchg_u32(ptr, old, new);
-               case 8:
-                       return __cmpxchg_u64(ptr, old, new);
-       }
-       __cmpxchg_called_with_bad_pointer();
-       return old;
-}
-
-#define cmpxchg(ptr, o, n)                                              \
-  ({                                                                    \
-     __typeof__(*(ptr)) _o_ = (o);                                      \
-     __typeof__(*(ptr)) _n_ = (n);                                      \
-     (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,          \
-                                   (unsigned long)_n_, sizeof(*(ptr))); \
-  })
-#define cmpxchg64(ptr, o, n)                                            \
-  ({                                                                    \
-       BUILD_BUG_ON(sizeof(*(ptr)) != 8);                               \
-       cmpxchg((ptr), (o), (n));                                        \
-  })
-
-static inline unsigned long
-__cmpxchg_u8_local(volatile char *m, long old, long new)
-{
-       unsigned long prev, tmp, cmp, addr64;
-
-       __asm__ __volatile__(
-       "       andnot  %5,7,%4\n"
-       "       insbl   %1,%5,%1\n"
-       "1:     ldq_l   %2,0(%4)\n"
-       "       extbl   %2,%5,%0\n"
-       "       cmpeq   %0,%6,%3\n"
-       "       beq     %3,2f\n"
-       "       mskbl   %2,%5,%2\n"
-       "       or      %1,%2,%2\n"
-       "       stq_c   %2,0(%4)\n"
-       "       beq     %2,3f\n"
-       "2:\n"
-       ".subsection 2\n"
-       "3:     br      1b\n"
-       ".previous"
-       : "=&r" (prev), "=&r" (new), "=&r" (tmp), "=&r" (cmp), "=&r" (addr64)
-       : "r" ((long)m), "Ir" (old), "1" (new) : "memory");
-
-       return prev;
-}
-
-static inline unsigned long
-__cmpxchg_u16_local(volatile short *m, long old, long new)
-{
-       unsigned long prev, tmp, cmp, addr64;
-
-       __asm__ __volatile__(
-       "       andnot  %5,7,%4\n"
-       "       inswl   %1,%5,%1\n"
-       "1:     ldq_l   %2,0(%4)\n"
-       "       extwl   %2,%5,%0\n"
-       "       cmpeq   %0,%6,%3\n"
-       "       beq     %3,2f\n"
-       "       mskwl   %2,%5,%2\n"
-       "       or      %1,%2,%2\n"
-       "       stq_c   %2,0(%4)\n"
-       "       beq     %2,3f\n"
-       "2:\n"
-       ".subsection 2\n"
-       "3:     br      1b\n"
-       ".previous"
-       : "=&r" (prev), "=&r" (new), "=&r" (tmp), "=&r" (cmp), "=&r" (addr64)
-       : "r" ((long)m), "Ir" (old), "1" (new) : "memory");
-
-       return prev;
-}
-
-static inline unsigned long
-__cmpxchg_u32_local(volatile int *m, int old, int new)
-{
-       unsigned long prev, cmp;
-
-       __asm__ __volatile__(
-       "1:     ldl_l %0,%5\n"
-       "       cmpeq %0,%3,%1\n"
-       "       beq %1,2f\n"
-       "       mov %4,%1\n"
-       "       stl_c %1,%2\n"
-       "       beq %1,3f\n"
-       "2:\n"
-       ".subsection 2\n"
-       "3:     br 1b\n"
-       ".previous"
-       : "=&r"(prev), "=&r"(cmp), "=m"(*m)
-       : "r"((long) old), "r"(new), "m"(*m) : "memory");
-
-       return prev;
-}
-
-static inline unsigned long
-__cmpxchg_u64_local(volatile long *m, unsigned long old, unsigned long new)
-{
-       unsigned long prev, cmp;
-
-       __asm__ __volatile__(
-       "1:     ldq_l %0,%5\n"
-       "       cmpeq %0,%3,%1\n"
-       "       beq %1,2f\n"
-       "       mov %4,%1\n"
-       "       stq_c %1,%2\n"
-       "       beq %1,3f\n"
-       "2:\n"
-       ".subsection 2\n"
-       "3:     br 1b\n"
-       ".previous"
-       : "=&r"(prev), "=&r"(cmp), "=m"(*m)
-       : "r"((long) old), "r"(new), "m"(*m) : "memory");
-
-       return prev;
-}
-
-static __always_inline unsigned long
-__cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
-               int size)
-{
-       switch (size) {
-               case 1:
-                       return __cmpxchg_u8_local(ptr, old, new);
-               case 2:
-                       return __cmpxchg_u16_local(ptr, old, new);
-               case 4:
-                       return __cmpxchg_u32_local(ptr, old, new);
-               case 8:
-                       return __cmpxchg_u64_local(ptr, old, new);
-       }
-       __cmpxchg_called_with_bad_pointer();
-       return old;
-}
-
-#define cmpxchg_local(ptr, o, n)                                        \
-  ({                                                                    \
-     __typeof__(*(ptr)) _o_ = (o);                                      \
-     __typeof__(*(ptr)) _n_ = (n);                                      \
-     (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_,    \
-                                   (unsigned long)_n_, sizeof(*(ptr))); \
-  })
-#define cmpxchg64_local(ptr, o, n)                                      \
-  ({                                                                    \
-       BUILD_BUG_ON(sizeof(*(ptr)) != 8);                               \
-       cmpxchg_local((ptr), (o), (n));                                  \
-  })
-
-
-#endif /* __ASSEMBLY__ */
-
-#define arch_align_stack(x) (x)
-
-#endif
diff --git a/include/asm-alpha/termbits.h b/include/asm-alpha/termbits.h
deleted file mode 100644 (file)
index ad854a4..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-#ifndef _ALPHA_TERMBITS_H
-#define _ALPHA_TERMBITS_H
-
-#include <linux/posix_types.h>
-
-typedef unsigned char  cc_t;
-typedef unsigned int   speed_t;
-typedef unsigned int   tcflag_t;
-
-/*
- * termios type and macro definitions.  Be careful about adding stuff
- * to this file since it's used in GNU libc and there are strict rules
- * concerning namespace pollution.
- */
-
-#define NCCS 19
-struct termios {
-       tcflag_t c_iflag;               /* input mode flags */
-       tcflag_t c_oflag;               /* output mode flags */
-       tcflag_t c_cflag;               /* control mode flags */
-       tcflag_t c_lflag;               /* local mode flags */
-       cc_t c_cc[NCCS];                /* control characters */
-       cc_t c_line;                    /* line discipline (== c_cc[19]) */
-       speed_t c_ispeed;               /* input speed */
-       speed_t c_ospeed;               /* output speed */
-};
-
-/* Alpha has matching termios and ktermios */
-
-struct ktermios {
-       tcflag_t c_iflag;               /* input mode flags */
-       tcflag_t c_oflag;               /* output mode flags */
-       tcflag_t c_cflag;               /* control mode flags */
-       tcflag_t c_lflag;               /* local mode flags */
-       cc_t c_cc[NCCS];                /* control characters */
-       cc_t c_line;                    /* line discipline (== c_cc[19]) */
-       speed_t c_ispeed;               /* input speed */
-       speed_t c_ospeed;               /* output speed */
-};
-
-/* c_cc characters */
-#define VEOF 0
-#define VEOL 1
-#define VEOL2 2
-#define VERASE 3
-#define VWERASE 4
-#define VKILL 5
-#define VREPRINT 6
-#define VSWTC 7
-#define VINTR 8
-#define VQUIT 9
-#define VSUSP 10
-#define VSTART 12
-#define VSTOP 13
-#define VLNEXT 14
-#define VDISCARD 15
-#define VMIN 16
-#define VTIME 17
-
-/* c_iflag bits */
-#define IGNBRK 0000001
-#define BRKINT 0000002
-#define IGNPAR 0000004
-#define PARMRK 0000010
-#define INPCK  0000020
-#define ISTRIP 0000040
-#define INLCR  0000100
-#define IGNCR  0000200
-#define ICRNL  0000400
-#define IXON   0001000
-#define IXOFF  0002000
-#define IXANY  0004000
-#define IUCLC  0010000
-#define IMAXBEL        0020000
-#define IUTF8  0040000
-
-/* c_oflag bits */
-#define OPOST  0000001
-#define ONLCR  0000002
-#define OLCUC  0000004
-
-#define OCRNL  0000010
-#define ONOCR  0000020
-#define ONLRET 0000040
-
-#define OFILL  00000100
-#define OFDEL  00000200
-#define NLDLY  00001400
-#define   NL0  00000000
-#define   NL1  00000400
-#define   NL2  00001000
-#define   NL3  00001400
-#define TABDLY 00006000
-#define   TAB0 00000000
-#define   TAB1 00002000
-#define   TAB2 00004000
-#define   TAB3 00006000
-#define CRDLY  00030000
-#define   CR0  00000000
-#define   CR1  00010000
-#define   CR2  00020000
-#define   CR3  00030000
-#define FFDLY  00040000
-#define   FF0  00000000
-#define   FF1  00040000
-#define BSDLY  00100000
-#define   BS0  00000000
-#define   BS1  00100000
-#define VTDLY  00200000
-#define   VT0  00000000
-#define   VT1  00200000
-#define XTABS  01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
-
-/* c_cflag bit meaning */
-#define CBAUD  0000037
-#define  B0    0000000         /* hang up */
-#define  B50   0000001
-#define  B75   0000002
-#define  B110  0000003
-#define  B134  0000004
-#define  B150  0000005
-#define  B200  0000006
-#define  B300  0000007
-#define  B600  0000010
-#define  B1200 0000011
-#define  B1800 0000012
-#define  B2400 0000013
-#define  B4800 0000014
-#define  B9600 0000015
-#define  B19200        0000016
-#define  B38400        0000017
-#define EXTA B19200
-#define EXTB B38400
-#define CBAUDEX 0000000
-#define  B57600   00020
-#define  B115200  00021
-#define  B230400  00022
-#define  B460800  00023
-#define  B500000  00024
-#define  B576000  00025
-#define  B921600  00026
-#define B1000000  00027
-#define B1152000  00030
-#define B1500000  00031
-#define B2000000  00032
-#define B2500000  00033
-#define B3000000  00034
-#define B3500000  00035
-#define B4000000  00036
-
-#define CSIZE  00001400
-#define   CS5  00000000
-#define   CS6  00000400
-#define   CS7  00001000
-#define   CS8  00001400
-
-#define CSTOPB 00002000
-#define CREAD  00004000
-#define PARENB 00010000
-#define PARODD 00020000
-#define HUPCL  00040000
-
-#define CLOCAL 00100000
-#define CMSPAR   010000000000          /* mark or space (stick) parity */
-#define CRTSCTS          020000000000          /* flow control */
-
-/* c_lflag bits */
-#define ISIG   0x00000080
-#define ICANON 0x00000100
-#define XCASE  0x00004000
-#define ECHO   0x00000008
-#define ECHOE  0x00000002
-#define ECHOK  0x00000004
-#define ECHONL 0x00000010
-#define NOFLSH 0x80000000
-#define TOSTOP 0x00400000
-#define ECHOCTL        0x00000040
-#define ECHOPRT        0x00000020
-#define ECHOKE 0x00000001
-#define FLUSHO 0x00800000
-#define PENDIN 0x20000000
-#define IEXTEN 0x00000400
-
-/* Values for the ACTION argument to `tcflow'.  */
-#define        TCOOFF          0
-#define        TCOON           1
-#define        TCIOFF          2
-#define        TCION           3
-
-/* Values for the QUEUE_SELECTOR argument to `tcflush'.  */
-#define        TCIFLUSH        0
-#define        TCOFLUSH        1
-#define        TCIOFLUSH       2
-
-/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'.  */
-#define        TCSANOW         0
-#define        TCSADRAIN       1
-#define        TCSAFLUSH       2
-
-#endif /* _ALPHA_TERMBITS_H */
diff --git a/include/asm-alpha/termios.h b/include/asm-alpha/termios.h
deleted file mode 100644 (file)
index fa13716..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-#ifndef _ALPHA_TERMIOS_H
-#define _ALPHA_TERMIOS_H
-
-#include <asm/ioctls.h>
-#include <asm/termbits.h>
-
-struct sgttyb {
-       char    sg_ispeed;
-       char    sg_ospeed;
-       char    sg_erase;
-       char    sg_kill;
-       short   sg_flags;
-};
-
-struct tchars {
-       char    t_intrc;
-       char    t_quitc;
-       char    t_startc;
-       char    t_stopc;
-       char    t_eofc;
-       char    t_brkc;
-};
-
-struct ltchars {
-       char    t_suspc;
-       char    t_dsuspc;
-       char    t_rprntc;
-       char    t_flushc;
-       char    t_werasc;
-       char    t_lnextc;
-};
-
-struct winsize {
-       unsigned short ws_row;
-       unsigned short ws_col;
-       unsigned short ws_xpixel;
-       unsigned short ws_ypixel;
-};
-
-#define NCC 8
-struct termio {
-       unsigned short c_iflag;         /* input mode flags */
-       unsigned short c_oflag;         /* output mode flags */
-       unsigned short c_cflag;         /* control mode flags */
-       unsigned short c_lflag;         /* local mode flags */
-       unsigned char c_line;           /* line discipline */
-       unsigned char c_cc[NCC];        /* control characters */
-};
-
-/*
- * c_cc characters in the termio structure.  Oh, how I love being
- * backwardly compatible.  Notice that character 4 and 5 are
- * interpreted differently depending on whether ICANON is set in
- * c_lflag.  If it's set, they are used as _VEOF and _VEOL, otherwise
- * as _VMIN and V_TIME.  This is for compatibility with OSF/1 (which
- * is compatible with sysV)...
- */
-#define _VINTR 0
-#define _VQUIT 1
-#define _VERASE        2
-#define _VKILL 3
-#define _VEOF  4
-#define _VMIN  4
-#define _VEOL  5
-#define _VTIME 5
-#define _VEOL2 6
-#define _VSWTC 7
-
-#ifdef __KERNEL__
-/*     eof=^D          eol=\0          eol2=\0         erase=del
-       werase=^W       kill=^U         reprint=^R      sxtc=\0
-       intr=^C         quit=^\         susp=^Z         <OSF/1 VDSUSP>
-       start=^Q        stop=^S         lnext=^V        discard=^U
-       vmin=\1         vtime=\0
-*/
-#define INIT_C_CC "\004\000\000\177\027\025\022\000\003\034\032\000\021\023\026\025\001\000"
-
-/*
- * Translate a "termio" structure into a "termios". Ugh.
- */
-
-#define user_termio_to_kernel_termios(a_termios, u_termio)                     \
-({                                                                             \
-       struct ktermios *k_termios = (a_termios);                               \
-       struct termio k_termio;                                                 \
-       int canon, ret;                                                         \
-                                                                               \
-       ret = copy_from_user(&k_termio, u_termio, sizeof(k_termio));            \
-       if (!ret) {                                                             \
-               /* Overwrite only the low bits.  */                             \
-               *(unsigned short *)&k_termios->c_iflag = k_termio.c_iflag;      \
-               *(unsigned short *)&k_termios->c_oflag = k_termio.c_oflag;      \
-               *(unsigned short *)&k_termios->c_cflag = k_termio.c_cflag;      \
-               *(unsigned short *)&k_termios->c_lflag = k_termio.c_lflag;      \
-               canon = k_termio.c_lflag & ICANON;                              \
-                                                                               \
-               k_termios->c_cc[VINTR]  = k_termio.c_cc[_VINTR];                \
-               k_termios->c_cc[VQUIT]  = k_termio.c_cc[_VQUIT];                \
-               k_termios->c_cc[VERASE] = k_termio.c_cc[_VERASE];               \
-               k_termios->c_cc[VKILL]  = k_termio.c_cc[_VKILL];                \
-               k_termios->c_cc[VEOL2]  = k_termio.c_cc[_VEOL2];                \
-               k_termios->c_cc[VSWTC]  = k_termio.c_cc[_VSWTC];                \
-               k_termios->c_cc[canon ? VEOF : VMIN]  = k_termio.c_cc[_VEOF];   \
-               k_termios->c_cc[canon ? VEOL : VTIME] = k_termio.c_cc[_VEOL];   \
-       }                                                                       \
-       ret;                                                                    \
-})
-
-/*
- * Translate a "termios" structure into a "termio". Ugh.
- *
- * Note the "fun" _VMIN overloading.
- */
-#define kernel_termios_to_user_termio(u_termio, a_termios)             \
-({                                                                     \
-       struct ktermios *k_termios = (a_termios);                       \
-       struct termio k_termio;                                         \
-       int canon;                                                      \
-                                                                       \
-       k_termio.c_iflag = k_termios->c_iflag;                          \
-       k_termio.c_oflag = k_termios->c_oflag;                          \
-       k_termio.c_cflag = k_termios->c_cflag;                          \
-       canon = (k_termio.c_lflag = k_termios->c_lflag) & ICANON;       \
-                                                                       \
-       k_termio.c_line = k_termios->c_line;                            \
-       k_termio.c_cc[_VINTR]  = k_termios->c_cc[VINTR];                \
-       k_termio.c_cc[_VQUIT]  = k_termios->c_cc[VQUIT];                \
-       k_termio.c_cc[_VERASE] = k_termios->c_cc[VERASE];               \
-       k_termio.c_cc[_VKILL]  = k_termios->c_cc[VKILL];                \
-       k_termio.c_cc[_VEOF]   = k_termios->c_cc[canon ? VEOF : VMIN];  \
-       k_termio.c_cc[_VEOL]   = k_termios->c_cc[canon ? VEOL : VTIME]; \
-       k_termio.c_cc[_VEOL2]  = k_termios->c_cc[VEOL2];                \
-       k_termio.c_cc[_VSWTC]  = k_termios->c_cc[VSWTC];                \
-                                                                       \
-       copy_to_user(u_termio, &k_termio, sizeof(k_termio));            \
-})
-
-#define user_termios_to_kernel_termios(k, u) \
-       copy_from_user(k, u, sizeof(struct termios))
-
-#define kernel_termios_to_user_termios(u, k) \
-       copy_to_user(u, k, sizeof(struct termios))
-
-#endif /* __KERNEL__ */
-
-#endif /* _ALPHA_TERMIOS_H */
diff --git a/include/asm-alpha/thread_info.h b/include/asm-alpha/thread_info.h
deleted file mode 100644 (file)
index 15fda43..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-#ifndef _ALPHA_THREAD_INFO_H
-#define _ALPHA_THREAD_INFO_H
-
-#ifdef __KERNEL__
-
-#ifndef __ASSEMBLY__
-#include <asm/processor.h>
-#include <asm/types.h>
-#include <asm/hwrpb.h>
-#endif
-
-#ifndef __ASSEMBLY__
-struct thread_info {
-       struct pcb_struct       pcb;            /* palcode state */
-
-       struct task_struct      *task;          /* main task structure */
-       unsigned int            flags;          /* low level flags */
-       unsigned int            ieee_state;     /* see fpu.h */
-
-       struct exec_domain      *exec_domain;   /* execution domain */
-       mm_segment_t            addr_limit;     /* thread address space */
-       unsigned                cpu;            /* current CPU */
-       int                     preempt_count; /* 0 => preemptable, <0 => BUG */
-
-       int bpt_nsaved;
-       unsigned long bpt_addr[2];              /* breakpoint handling  */
-       unsigned int bpt_insn[2];
-
-       struct restart_block    restart_block;
-};
-
-/*
- * Macros/functions for gaining access to the thread information structure.
- */
-#define INIT_THREAD_INFO(tsk)                  \
-{                                              \
-       .task           = &tsk,                 \
-       .exec_domain    = &default_exec_domain, \
-       .addr_limit     = KERNEL_DS,            \
-       .restart_block = {                      \
-               .fn = do_no_restart_syscall,    \
-       },                                      \
-}
-
-#define init_thread_info       (init_thread_union.thread_info)
-#define init_stack             (init_thread_union.stack)
-
-/* How to get the thread information struct from C.  */
-register struct thread_info *__current_thread_info __asm__("$8");
-#define current_thread_info()  __current_thread_info
-
-/* Thread information allocation.  */
-#define THREAD_SIZE_ORDER 1
-#define THREAD_SIZE (2*PAGE_SIZE)
-
-#endif /* __ASSEMBLY__ */
-
-#define PREEMPT_ACTIVE         0x40000000
-
-/*
- * Thread information flags:
- * - these are process state flags and used from assembly
- * - pending work-to-be-done flags come first to fit in and immediate operand.
- *
- * TIF_SYSCALL_TRACE is known to be 0 via blbs.
- */
-#define TIF_SYSCALL_TRACE      0       /* syscall trace active */
-#define TIF_SIGPENDING         1       /* signal pending */
-#define TIF_NEED_RESCHED       2       /* rescheduling necessary */
-#define TIF_POLLING_NRFLAG     3       /* poll_idle is polling NEED_RESCHED */
-#define TIF_DIE_IF_KERNEL      4       /* dik recursion lock */
-#define TIF_UAC_NOPRINT                5       /* see sysinfo.h */
-#define TIF_UAC_NOFIX          6
-#define TIF_UAC_SIGBUS         7
-#define TIF_MEMDIE             8
-#define TIF_RESTORE_SIGMASK    9       /* restore signal mask in do_signal */
-
-#define _TIF_SYSCALL_TRACE     (1<<TIF_SYSCALL_TRACE)
-#define _TIF_SIGPENDING                (1<<TIF_SIGPENDING)
-#define _TIF_NEED_RESCHED      (1<<TIF_NEED_RESCHED)
-#define _TIF_POLLING_NRFLAG    (1<<TIF_POLLING_NRFLAG)
-#define _TIF_RESTORE_SIGMASK   (1<<TIF_RESTORE_SIGMASK)
-
-/* Work to do on interrupt/exception return.  */
-#define _TIF_WORK_MASK         (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
-
-/* Work to do on any return to userspace.  */
-#define _TIF_ALLWORK_MASK      (_TIF_WORK_MASK         \
-                                | _TIF_SYSCALL_TRACE)
-
-#define ALPHA_UAC_SHIFT                6
-#define ALPHA_UAC_MASK         (1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \
-                                1 << TIF_UAC_SIGBUS)
-
-#define SET_UNALIGN_CTL(task,value)    ({                                   \
-       task_thread_info(task)->flags = ((task_thread_info(task)->flags &    \
-               ~ALPHA_UAC_MASK)                                             \
-               | (((value) << ALPHA_UAC_SHIFT)       & (1<<TIF_UAC_NOPRINT))\
-               | (((value) << (ALPHA_UAC_SHIFT + 1)) & (1<<TIF_UAC_SIGBUS)) \
-               | (((value) << (ALPHA_UAC_SHIFT - 1)) & (1<<TIF_UAC_NOFIX)));\
-       0; })
-
-#define GET_UNALIGN_CTL(task,value)    ({                              \
-       put_user((task_thread_info(task)->flags & (1 << TIF_UAC_NOPRINT))\
-                 >> ALPHA_UAC_SHIFT                                    \
-                | (task_thread_info(task)->flags & (1 << TIF_UAC_SIGBUS))\
-                >> (ALPHA_UAC_SHIFT + 1)                               \
-                | (task_thread_info(task)->flags & (1 << TIF_UAC_NOFIX))\
-                >> (ALPHA_UAC_SHIFT - 1),                              \
-                (int __user *)(value));                                \
-       })
-
-#endif /* __KERNEL__ */
-#endif /* _ALPHA_THREAD_INFO_H */
diff --git a/include/asm-alpha/timex.h b/include/asm-alpha/timex.h
deleted file mode 100644 (file)
index afa0c45..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * linux/include/asm-alpha/timex.h
- *
- * ALPHA architecture timex specifications
- */
-#ifndef _ASMALPHA_TIMEX_H
-#define _ASMALPHA_TIMEX_H
-
-/* With only one or two oddballs, we use the RTC as the ticker, selecting
-   the 32.768kHz reference clock, which nicely divides down to our HZ.  */
-#define CLOCK_TICK_RATE        32768
-
-/*
- * Standard way to access the cycle counter.
- * Currently only used on SMP for scheduling.
- *
- * Only the low 32 bits are available as a continuously counting entity. 
- * But this only means we'll force a reschedule every 8 seconds or so,
- * which isn't an evil thing.
- */
-
-typedef unsigned int cycles_t;
-
-static inline cycles_t get_cycles (void)
-{
-       cycles_t ret;
-       __asm__ __volatile__ ("rpcc %0" : "=r"(ret));
-       return ret;
-}
-
-#endif
diff --git a/include/asm-alpha/tlb.h b/include/asm-alpha/tlb.h
deleted file mode 100644 (file)
index c136365..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef _ALPHA_TLB_H
-#define _ALPHA_TLB_H
-
-#define tlb_start_vma(tlb, vma)                        do { } while (0)
-#define tlb_end_vma(tlb, vma)                  do { } while (0)
-#define __tlb_remove_tlb_entry(tlb, pte, addr) do { } while (0)
-
-#define tlb_flush(tlb)                         flush_tlb_mm((tlb)->mm)
-
-#include <asm-generic/tlb.h>
-
-#define __pte_free_tlb(tlb, pte)                       pte_free((tlb)->mm, pte)
-#define __pmd_free_tlb(tlb, pmd)                       pmd_free((tlb)->mm, pmd)
-#endif
diff --git a/include/asm-alpha/tlbflush.h b/include/asm-alpha/tlbflush.h
deleted file mode 100644 (file)
index 9d87aaa..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-#ifndef _ALPHA_TLBFLUSH_H
-#define _ALPHA_TLBFLUSH_H
-
-#include <linux/mm.h>
-#include <asm/compiler.h>
-#include <asm/pgalloc.h>
-
-#ifndef __EXTERN_INLINE
-#define __EXTERN_INLINE extern inline
-#define __MMU_EXTERN_INLINE
-#endif
-
-extern void __load_new_mm_context(struct mm_struct *);
-
-
-/* Use a few helper functions to hide the ugly broken ASN
-   numbers on early Alphas (ev4 and ev45).  */
-
-__EXTERN_INLINE void
-ev4_flush_tlb_current(struct mm_struct *mm)
-{
-       __load_new_mm_context(mm);
-       tbiap();
-}
-
-__EXTERN_INLINE void
-ev5_flush_tlb_current(struct mm_struct *mm)
-{
-       __load_new_mm_context(mm);
-}
-
-/* Flush just one page in the current TLB set.  We need to be very
-   careful about the icache here, there is no way to invalidate a
-   specific icache page.  */
-
-__EXTERN_INLINE void
-ev4_flush_tlb_current_page(struct mm_struct * mm,
-                          struct vm_area_struct *vma,
-                          unsigned long addr)
-{
-       int tbi_flag = 2;
-       if (vma->vm_flags & VM_EXEC) {
-               __load_new_mm_context(mm);
-               tbi_flag = 3;
-       }
-       tbi(tbi_flag, addr);
-}
-
-__EXTERN_INLINE void
-ev5_flush_tlb_current_page(struct mm_struct * mm,
-                          struct vm_area_struct *vma,
-                          unsigned long addr)
-{
-       if (vma->vm_flags & VM_EXEC)
-               __load_new_mm_context(mm);
-       else
-               tbi(2, addr);
-}
-
-
-#ifdef CONFIG_ALPHA_GENERIC
-# define flush_tlb_current             alpha_mv.mv_flush_tlb_current
-# define flush_tlb_current_page                alpha_mv.mv_flush_tlb_current_page
-#else
-# ifdef CONFIG_ALPHA_EV4
-#  define flush_tlb_current            ev4_flush_tlb_current
-#  define flush_tlb_current_page       ev4_flush_tlb_current_page
-# else
-#  define flush_tlb_current            ev5_flush_tlb_current
-#  define flush_tlb_current_page       ev5_flush_tlb_current_page
-# endif
-#endif
-
-#ifdef __MMU_EXTERN_INLINE
-#undef __EXTERN_INLINE
-#undef __MMU_EXTERN_INLINE
-#endif
-
-/* Flush current user mapping.  */
-static inline void
-flush_tlb(void)
-{
-       flush_tlb_current(current->active_mm);
-}
-
-/* Flush someone else's user mapping.  */
-static inline void
-flush_tlb_other(struct mm_struct *mm)
-{
-       unsigned long *mmc = &mm->context[smp_processor_id()];
-       /* Check it's not zero first to avoid cacheline ping pong
-          when possible.  */
-       if (*mmc) *mmc = 0;
-}
-
-#ifndef CONFIG_SMP
-/* Flush everything (kernel mapping may also have changed
-   due to vmalloc/vfree).  */
-static inline void flush_tlb_all(void)
-{
-       tbia();
-}
-
-/* Flush a specified user mapping.  */
-static inline void
-flush_tlb_mm(struct mm_struct *mm)
-{
-       if (mm == current->active_mm)
-               flush_tlb_current(mm);
-       else
-               flush_tlb_other(mm);
-}
-
-/* Page-granular tlb flush.  */
-static inline void
-flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
-{
-       struct mm_struct *mm = vma->vm_mm;
-
-       if (mm == current->active_mm)
-               flush_tlb_current_page(mm, vma, addr);
-       else
-               flush_tlb_other(mm);
-}
-
-/* Flush a specified range of user mapping.  On the Alpha we flush
-   the whole user tlb.  */
-static inline void
-flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
-               unsigned long end)
-{
-       flush_tlb_mm(vma->vm_mm);
-}
-
-#else /* CONFIG_SMP */
-
-extern void flush_tlb_all(void);
-extern void flush_tlb_mm(struct mm_struct *);
-extern void flush_tlb_page(struct vm_area_struct *, unsigned long);
-extern void flush_tlb_range(struct vm_area_struct *, unsigned long,
-                           unsigned long);
-
-#endif /* CONFIG_SMP */
-
-static inline void flush_tlb_kernel_range(unsigned long start,
-                                       unsigned long end)
-{
-       flush_tlb_all();
-}
-
-#endif /* _ALPHA_TLBFLUSH_H */
diff --git a/include/asm-alpha/topology.h b/include/asm-alpha/topology.h
deleted file mode 100644 (file)
index 149532e..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef _ASM_ALPHA_TOPOLOGY_H
-#define _ASM_ALPHA_TOPOLOGY_H
-
-#include <linux/smp.h>
-#include <linux/threads.h>
-#include <asm/machvec.h>
-
-#ifdef CONFIG_NUMA
-static inline int cpu_to_node(int cpu)
-{
-       int node;
-       
-       if (!alpha_mv.cpuid_to_nid)
-               return 0;
-
-       node = alpha_mv.cpuid_to_nid(cpu);
-
-#ifdef DEBUG_NUMA
-       BUG_ON(node < 0);
-#endif
-
-       return node;
-}
-
-static inline cpumask_t node_to_cpumask(int node)
-{
-       cpumask_t node_cpu_mask = CPU_MASK_NONE;
-       int cpu;
-
-       for_each_online_cpu(cpu) {
-               if (cpu_to_node(cpu) == node)
-                       cpu_set(cpu, node_cpu_mask);
-       }
-
-#ifdef DEBUG_NUMA
-       printk("node %d: cpu_mask: %016lx\n", node, node_cpu_mask);
-#endif
-
-       return node_cpu_mask;
-}
-
-#define pcibus_to_cpumask(bus) (cpu_online_map)
-
-#endif /* !CONFIG_NUMA */
-# include <asm-generic/topology.h>
-
-#endif /* _ASM_ALPHA_TOPOLOGY_H */
diff --git a/include/asm-alpha/types.h b/include/asm-alpha/types.h
deleted file mode 100644 (file)
index c154135..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef _ALPHA_TYPES_H
-#define _ALPHA_TYPES_H
-
-/*
- * This file is never included by application software unless
- * explicitly requested (e.g., via linux/types.h) in which case the
- * application is Linux specific so (user-) name space pollution is
- * not a major issue.  However, for interoperability, libraries still
- * need to be careful to avoid a name clashes.
- */
-#include <asm-generic/int-l64.h>
-
-#ifndef __ASSEMBLY__
-
-typedef unsigned int umode_t;
-
-#endif /* __ASSEMBLY__ */
-
-/*
- * These aren't exported outside the kernel to avoid name space clashes
- */
-#ifdef __KERNEL__
-
-#define BITS_PER_LONG 64
-
-#ifndef __ASSEMBLY__
-
-typedef u64 dma_addr_t;
-typedef u64 dma64_addr_t;
-
-#endif /* __ASSEMBLY__ */
-#endif /* __KERNEL__ */
-#endif /* _ALPHA_TYPES_H */
diff --git a/include/asm-alpha/uaccess.h b/include/asm-alpha/uaccess.h
deleted file mode 100644 (file)
index 22de3b4..0000000
+++ /dev/null
@@ -1,511 +0,0 @@
-#ifndef __ALPHA_UACCESS_H
-#define __ALPHA_UACCESS_H
-
-#include <linux/errno.h>
-#include <linux/sched.h>
-
-
-/*
- * The fs value determines whether argument validity checking should be
- * performed or not.  If get_fs() == USER_DS, checking is performed, with
- * get_fs() == KERNEL_DS, checking is bypassed.
- *
- * Or at least it did once upon a time.  Nowadays it is a mask that
- * defines which bits of the address space are off limits.  This is a
- * wee bit faster than the above.
- *
- * For historical reasons, these macros are grossly misnamed.
- */
-
-#define KERNEL_DS      ((mm_segment_t) { 0UL })
-#define USER_DS                ((mm_segment_t) { -0x40000000000UL })
-
-#define VERIFY_READ    0
-#define VERIFY_WRITE   1
-
-#define get_fs()  (current_thread_info()->addr_limit)
-#define get_ds()  (KERNEL_DS)
-#define set_fs(x) (current_thread_info()->addr_limit = (x))
-
-#define segment_eq(a,b)        ((a).seg == (b).seg)
-
-/*
- * Is a address valid? This does a straightforward calculation rather
- * than tests.
- *
- * Address valid if:
- *  - "addr" doesn't have any high-bits set
- *  - AND "size" doesn't have any high-bits set
- *  - AND "addr+size" doesn't have any high-bits set
- *  - OR we are in kernel mode.
- */
-#define __access_ok(addr,size,segment) \
-       (((segment).seg & (addr | size | (addr+size))) == 0)
-
-#define access_ok(type,addr,size)                              \
-({                                                             \
-       __chk_user_ptr(addr);                                   \
-       __access_ok(((unsigned long)(addr)),(size),get_fs());   \
-})
-
-/*
- * These are the main single-value transfer routines.  They automatically
- * use the right size if we just have the right pointer type.
- *
- * As the alpha uses the same address space for kernel and user
- * data, we can just do these as direct assignments.  (Of course, the
- * exception handling means that it's no longer "just"...)
- *
- * Careful to not
- * (a) re-use the arguments for side effects (sizeof/typeof is ok)
- * (b) require any knowledge of processes at this stage
- */
-#define put_user(x,ptr) \
-  __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)),get_fs())
-#define get_user(x,ptr) \
-  __get_user_check((x),(ptr),sizeof(*(ptr)),get_fs())
-
-/*
- * The "__xxx" versions do not do address space checking, useful when
- * doing multiple accesses to the same area (the programmer has to do the
- * checks by hand with "access_ok()")
- */
-#define __put_user(x,ptr) \
-  __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
-#define __get_user(x,ptr) \
-  __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
-  
-/*
- * The "lda %1, 2b-1b(%0)" bits are magic to get the assembler to
- * encode the bits we need for resolving the exception.  See the
- * more extensive comments with fixup_inline_exception below for
- * more information.
- */
-
-extern void __get_user_unknown(void);
-
-#define __get_user_nocheck(x,ptr,size)                         \
-({                                                             \
-       long __gu_err = 0;                                      \
-       unsigned long __gu_val;                                 \
-       __chk_user_ptr(ptr);                                    \
-       switch (size) {                                         \
-         case 1: __get_user_8(ptr); break;                     \
-         case 2: __get_user_16(ptr); break;                    \
-         case 4: __get_user_32(ptr); break;                    \
-         case 8: __get_user_64(ptr); break;                    \
-         default: __get_user_unknown(); break;                 \
-       }                                                       \
-       (x) = (__typeof__(*(ptr))) __gu_val;                    \
-       __gu_err;                                               \
-})
-
-#define __get_user_check(x,ptr,size,segment)                           \
-({                                                                     \
-       long __gu_err = -EFAULT;                                        \
-       unsigned long __gu_val = 0;                                     \
-       const __typeof__(*(ptr)) __user *__gu_addr = (ptr);             \
-       if (__access_ok((unsigned long)__gu_addr,size,segment)) {       \
-               __gu_err = 0;                                           \
-               switch (size) {                                         \
-                 case 1: __get_user_8(__gu_addr); break;               \
-                 case 2: __get_user_16(__gu_addr); break;              \
-                 case 4: __get_user_32(__gu_addr); break;              \
-                 case 8: __get_user_64(__gu_addr); break;              \
-                 default: __get_user_unknown(); break;                 \
-               }                                                       \
-       }                                                               \
-       (x) = (__typeof__(*(ptr))) __gu_val;                            \
-       __gu_err;                                                       \
-})
-
-struct __large_struct { unsigned long buf[100]; };
-#define __m(x) (*(struct __large_struct __user *)(x))
-
-#define __get_user_64(addr)                            \
-       __asm__("1: ldq %0,%2\n"                        \
-       "2:\n"                                          \
-       ".section __ex_table,\"a\"\n"                   \
-       "       .long 1b - .\n"                         \
-       "       lda %0, 2b-1b(%1)\n"                    \
-       ".previous"                                     \
-               : "=r"(__gu_val), "=r"(__gu_err)        \
-               : "m"(__m(addr)), "1"(__gu_err))
-
-#define __get_user_32(addr)                            \
-       __asm__("1: ldl %0,%2\n"                        \
-       "2:\n"                                          \
-       ".section __ex_table,\"a\"\n"                   \
-       "       .long 1b - .\n"                         \
-       "       lda %0, 2b-1b(%1)\n"                    \
-       ".previous"                                     \
-               : "=r"(__gu_val), "=r"(__gu_err)        \
-               : "m"(__m(addr)), "1"(__gu_err))
-
-#ifdef __alpha_bwx__
-/* Those lucky bastards with ev56 and later CPUs can do byte/word moves.  */
-
-#define __get_user_16(addr)                            \
-       __asm__("1: ldwu %0,%2\n"                       \
-       "2:\n"                                          \
-       ".section __ex_table,\"a\"\n"                   \
-       "       .long 1b - .\n"                         \
-       "       lda %0, 2b-1b(%1)\n"                    \
-       ".previous"                                     \
-               : "=r"(__gu_val), "=r"(__gu_err)        \
-               : "m"(__m(addr)), "1"(__gu_err))
-
-#define __get_user_8(addr)                             \
-       __asm__("1: ldbu %0,%2\n"                       \
-       "2:\n"                                          \
-       ".section __ex_table,\"a\"\n"                   \
-       "       .long 1b - .\n"                         \
-       "       lda %0, 2b-1b(%1)\n"                    \
-       ".previous"                                     \
-               : "=r"(__gu_val), "=r"(__gu_err)        \
-               : "m"(__m(addr)), "1"(__gu_err))
-#else
-/* Unfortunately, we can't get an unaligned access trap for the sub-word
-   load, so we have to do a general unaligned operation.  */
-
-#define __get_user_16(addr)                                            \
-{                                                                      \
-       long __gu_tmp;                                                  \
-       __asm__("1: ldq_u %0,0(%3)\n"                                   \
-       "2:     ldq_u %1,1(%3)\n"                                       \
-       "       extwl %0,%3,%0\n"                                       \
-       "       extwh %1,%3,%1\n"                                       \
-       "       or %0,%1,%0\n"                                          \
-       "3:\n"                                                          \
-       ".section __ex_table,\"a\"\n"                                   \
-       "       .long 1b - .\n"                                         \
-       "       lda %0, 3b-1b(%2)\n"                                    \
-       "       .long 2b - .\n"                                         \
-       "       lda %0, 3b-2b(%2)\n"                                    \
-       ".previous"                                                     \
-               : "=&r"(__gu_val), "=&r"(__gu_tmp), "=r"(__gu_err)      \
-               : "r"(addr), "2"(__gu_err));                            \
-}
-
-#define __get_user_8(addr)                                             \
-       __asm__("1: ldq_u %0,0(%2)\n"                                   \
-       "       extbl %0,%2,%0\n"                                       \
-       "2:\n"                                                          \
-       ".section __ex_table,\"a\"\n"                                   \
-       "       .long 1b - .\n"                                         \
-       "       lda %0, 2b-1b(%1)\n"                                    \
-       ".previous"                                                     \
-               : "=&r"(__gu_val), "=r"(__gu_err)                       \
-               : "r"(addr), "1"(__gu_err))
-#endif
-
-extern void __put_user_unknown(void);
-
-#define __put_user_nocheck(x,ptr,size)                         \
-({                                                             \
-       long __pu_err = 0;                                      \
-       __chk_user_ptr(ptr);                                    \
-       switch (size) {                                         \
-         case 1: __put_user_8(x,ptr); break;                   \
-         case 2: __put_user_16(x,ptr); break;                  \
-         case 4: __put_user_32(x,ptr); break;                  \
-         case 8: __put_user_64(x,ptr); break;                  \
-         default: __put_user_unknown(); break;                 \
-       }                                                       \
-       __pu_err;                                               \
-})
-
-#define __put_user_check(x,ptr,size,segment)                           \
-({                                                                     \
-       long __pu_err = -EFAULT;                                        \
-       __typeof__(*(ptr)) __user *__pu_addr = (ptr);                   \
-       if (__access_ok((unsigned long)__pu_addr,size,segment)) {       \
-               __pu_err = 0;                                           \
-               switch (size) {                                         \
-                 case 1: __put_user_8(x,__pu_addr); break;             \
-                 case 2: __put_user_16(x,__pu_addr); break;            \
-                 case 4: __put_user_32(x,__pu_addr); break;            \
-                 case 8: __put_user_64(x,__pu_addr); break;            \
-                 default: __put_user_unknown(); break;                 \
-               }                                                       \
-       }                                                               \
-       __pu_err;                                                       \
-})
-
-/*
- * The "__put_user_xx()" macros tell gcc they read from memory
- * instead of writing: this is because they do not write to
- * any memory gcc knows about, so there are no aliasing issues
- */
-#define __put_user_64(x,addr)                                  \
-__asm__ __volatile__("1: stq %r2,%1\n"                         \
-       "2:\n"                                                  \
-       ".section __ex_table,\"a\"\n"                           \
-       "       .long 1b - .\n"                                 \
-       "       lda $31,2b-1b(%0)\n"                            \
-       ".previous"                                             \
-               : "=r"(__pu_err)                                \
-               : "m" (__m(addr)), "rJ" (x), "0"(__pu_err))
-
-#define __put_user_32(x,addr)                                  \
-__asm__ __volatile__("1: stl %r2,%1\n"                         \
-       "2:\n"                                                  \
-       ".section __ex_table,\"a\"\n"                           \
-       "       .long 1b - .\n"                                 \
-       "       lda $31,2b-1b(%0)\n"                            \
-       ".previous"                                             \
-               : "=r"(__pu_err)                                \
-               : "m"(__m(addr)), "rJ"(x), "0"(__pu_err))
-
-#ifdef __alpha_bwx__
-/* Those lucky bastards with ev56 and later CPUs can do byte/word moves.  */
-
-#define __put_user_16(x,addr)                                  \
-__asm__ __volatile__("1: stw %r2,%1\n"                         \
-       "2:\n"                                                  \
-       ".section __ex_table,\"a\"\n"                           \
-       "       .long 1b - .\n"                                 \
-       "       lda $31,2b-1b(%0)\n"                            \
-       ".previous"                                             \
-               : "=r"(__pu_err)                                \
-               : "m"(__m(addr)), "rJ"(x), "0"(__pu_err))
-
-#define __put_user_8(x,addr)                                   \
-__asm__ __volatile__("1: stb %r2,%1\n"                         \
-       "2:\n"                                                  \
-       ".section __ex_table,\"a\"\n"                           \
-       "       .long 1b - .\n"                                 \
-       "       lda $31,2b-1b(%0)\n"                            \
-       ".previous"                                             \
-               : "=r"(__pu_err)                                \
-               : "m"(__m(addr)), "rJ"(x), "0"(__pu_err))
-#else
-/* Unfortunately, we can't get an unaligned access trap for the sub-word
-   write, so we have to do a general unaligned operation.  */
-
-#define __put_user_16(x,addr)                                  \
-{                                                              \
-       long __pu_tmp1, __pu_tmp2, __pu_tmp3, __pu_tmp4;        \
-       __asm__ __volatile__(                                   \
-       "1:     ldq_u %2,1(%5)\n"                               \
-       "2:     ldq_u %1,0(%5)\n"                               \
-       "       inswh %6,%5,%4\n"                               \
-       "       inswl %6,%5,%3\n"                               \
-       "       mskwh %2,%5,%2\n"                               \
-       "       mskwl %1,%5,%1\n"                               \
-       "       or %2,%4,%2\n"                                  \
-       "       or %1,%3,%1\n"                                  \
-       "3:     stq_u %2,1(%5)\n"                               \
-       "4:     stq_u %1,0(%5)\n"                               \
-       "5:\n"                                                  \
-       ".section __ex_table,\"a\"\n"                           \
-       "       .long 1b - .\n"                                 \
-       "       lda $31, 5b-1b(%0)\n"                           \
-       "       .long 2b - .\n"                                 \
-       "       lda $31, 5b-2b(%0)\n"                           \
-       "       .long 3b - .\n"                                 \
-       "       lda $31, 5b-3b(%0)\n"                           \
-       "       .long 4b - .\n"                                 \
-       "       lda $31, 5b-4b(%0)\n"                           \
-       ".previous"                                             \
-               : "=r"(__pu_err), "=&r"(__pu_tmp1),             \
-                 "=&r"(__pu_tmp2), "=&r"(__pu_tmp3),           \
-                 "=&r"(__pu_tmp4)                              \
-               : "r"(addr), "r"((unsigned long)(x)), "0"(__pu_err)); \
-}
-
-#define __put_user_8(x,addr)                                   \
-{                                                              \
-       long __pu_tmp1, __pu_tmp2;                              \
-       __asm__ __volatile__(                                   \
-       "1:     ldq_u %1,0(%4)\n"                               \
-       "       insbl %3,%4,%2\n"                               \
-       "       mskbl %1,%4,%1\n"                               \
-       "       or %1,%2,%1\n"                                  \
-       "2:     stq_u %1,0(%4)\n"                               \
-       "3:\n"                                                  \
-       ".section __ex_table,\"a\"\n"                           \
-       "       .long 1b - .\n"                                 \
-       "       lda $31, 3b-1b(%0)\n"                           \
-       "       .long 2b - .\n"                                 \
-       "       lda $31, 3b-2b(%0)\n"                           \
-       ".previous"                                             \
-               : "=r"(__pu_err),                               \
-                 "=&r"(__pu_tmp1), "=&r"(__pu_tmp2)            \
-               : "r"((unsigned long)(x)), "r"(addr), "0"(__pu_err)); \
-}
-#endif
-
-
-/*
- * Complex access routines
- */
-
-/* This little bit of silliness is to get the GP loaded for a function
-   that ordinarily wouldn't.  Otherwise we could have it done by the macro
-   directly, which can be optimized the linker.  */
-#ifdef MODULE
-#define __module_address(sym)          "r"(sym),
-#define __module_call(ra, arg, sym)    "jsr $" #ra ",(%" #arg ")," #sym
-#else
-#define __module_address(sym)
-#define __module_call(ra, arg, sym)    "bsr $" #ra "," #sym " !samegp"
-#endif
-
-extern void __copy_user(void);
-
-extern inline long
-__copy_tofrom_user_nocheck(void *to, const void *from, long len)
-{
-       register void * __cu_to __asm__("$6") = to;
-       register const void * __cu_from __asm__("$7") = from;
-       register long __cu_len __asm__("$0") = len;
-
-       __asm__ __volatile__(
-               __module_call(28, 3, __copy_user)
-               : "=r" (__cu_len), "=r" (__cu_from), "=r" (__cu_to)
-               : __module_address(__copy_user)
-                 "0" (__cu_len), "1" (__cu_from), "2" (__cu_to)
-               : "$1","$2","$3","$4","$5","$28","memory");
-
-       return __cu_len;
-}
-
-extern inline long
-__copy_tofrom_user(void *to, const void *from, long len, const void __user *validate)
-{
-       if (__access_ok((unsigned long)validate, len, get_fs()))
-               len = __copy_tofrom_user_nocheck(to, from, len);
-       return len;
-}
-
-#define __copy_to_user(to,from,n)                                      \
-({                                                                     \
-       __chk_user_ptr(to);                                             \
-       __copy_tofrom_user_nocheck((__force void *)(to),(from),(n));    \
-})
-#define __copy_from_user(to,from,n)                                    \
-({                                                                     \
-       __chk_user_ptr(from);                                           \
-       __copy_tofrom_user_nocheck((to),(__force void *)(from),(n));    \
-})
-
-#define __copy_to_user_inatomic __copy_to_user
-#define __copy_from_user_inatomic __copy_from_user
-
-
-extern inline long
-copy_to_user(void __user *to, const void *from, long n)
-{
-       return __copy_tofrom_user((__force void *)to, from, n, to);
-}
-
-extern inline long
-copy_from_user(void *to, const void __user *from, long n)
-{
-       return __copy_tofrom_user(to, (__force void *)from, n, from);
-}
-
-extern void __do_clear_user(void);
-
-extern inline long
-__clear_user(void __user *to, long len)
-{
-       register void __user * __cl_to __asm__("$6") = to;
-       register long __cl_len __asm__("$0") = len;
-       __asm__ __volatile__(
-               __module_call(28, 2, __do_clear_user)
-               : "=r"(__cl_len), "=r"(__cl_to)
-               : __module_address(__do_clear_user)
-                 "0"(__cl_len), "1"(__cl_to)
-               : "$1","$2","$3","$4","$5","$28","memory");
-       return __cl_len;
-}
-
-extern inline long
-clear_user(void __user *to, long len)
-{
-       if (__access_ok((unsigned long)to, len, get_fs()))
-               len = __clear_user(to, len);
-       return len;
-}
-
-#undef __module_address
-#undef __module_call
-
-/* Returns: -EFAULT if exception before terminator, N if the entire
-   buffer filled, else strlen.  */
-
-extern long __strncpy_from_user(char *__to, const char __user *__from, long __to_len);
-
-extern inline long
-strncpy_from_user(char *to, const char __user *from, long n)
-{
-       long ret = -EFAULT;
-       if (__access_ok((unsigned long)from, 0, get_fs()))
-               ret = __strncpy_from_user(to, from, n);
-       return ret;
-}
-
-/* Returns: 0 if bad, string length+1 (memory size) of string if ok */
-extern long __strlen_user(const char __user *);
-
-extern inline long strlen_user(const char __user *str)
-{
-       return access_ok(VERIFY_READ,str,0) ? __strlen_user(str) : 0;
-}
-
-/* Returns: 0 if exception before NUL or reaching the supplied limit (N),
- * a value greater than N if the limit would be exceeded, else strlen.  */
-extern long __strnlen_user(const char __user *, long);
-
-extern inline long strnlen_user(const char __user *str, long n)
-{
-       return access_ok(VERIFY_READ,str,0) ? __strnlen_user(str, n) : 0;
-}
-
-/*
- * About the exception table:
- *
- * - insn is a 32-bit pc-relative offset from the faulting insn.
- * - nextinsn is a 16-bit offset off of the faulting instruction
- *   (not off of the *next* instruction as branches are).
- * - errreg is the register in which to place -EFAULT.
- * - valreg is the final target register for the load sequence
- *   and will be zeroed.
- *
- * Either errreg or valreg may be $31, in which case nothing happens.
- *
- * The exception fixup information "just so happens" to be arranged
- * as in a MEM format instruction.  This lets us emit our three
- * values like so:
- *
- *      lda valreg, nextinsn(errreg)
- *
- */
-
-struct exception_table_entry
-{
-       signed int insn;
-       union exception_fixup {
-               unsigned unit;
-               struct {
-                       signed int nextinsn : 16;
-                       unsigned int errreg : 5;
-                       unsigned int valreg : 5;
-               } bits;
-       } fixup;
-};
-
-/* Returns the new pc */
-#define fixup_exception(map_reg, fixup, pc)                    \
-({                                                             \
-       if ((fixup)->fixup.bits.valreg != 31)                   \
-               map_reg((fixup)->fixup.bits.valreg) = 0;        \
-       if ((fixup)->fixup.bits.errreg != 31)                   \
-               map_reg((fixup)->fixup.bits.errreg) = -EFAULT;  \
-       (pc) + (fixup)->fixup.bits.nextinsn;                    \
-})
-
-
-#endif /* __ALPHA_UACCESS_H */
diff --git a/include/asm-alpha/ucontext.h b/include/asm-alpha/ucontext.h
deleted file mode 100644 (file)
index 47578ab..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _ASMAXP_UCONTEXT_H
-#define _ASMAXP_UCONTEXT_H
-
-struct ucontext {
-       unsigned long     uc_flags;
-       struct ucontext  *uc_link;
-       old_sigset_t      uc_osf_sigmask;
-       stack_t           uc_stack;
-       struct sigcontext uc_mcontext;
-       sigset_t          uc_sigmask;   /* mask last for extensibility */
-};
-
-#endif /* !_ASMAXP_UCONTEXT_H */
diff --git a/include/asm-alpha/unaligned.h b/include/asm-alpha/unaligned.h
deleted file mode 100644 (file)
index 3787c60..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _ASM_ALPHA_UNALIGNED_H
-#define _ASM_ALPHA_UNALIGNED_H
-
-#include <linux/unaligned/le_struct.h>
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#define get_unaligned __get_unaligned_le
-#define put_unaligned __put_unaligned_le
-
-#endif /* _ASM_ALPHA_UNALIGNED_H */
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h
deleted file mode 100644 (file)
index 5b5c174..0000000
+++ /dev/null
@@ -1,464 +0,0 @@
-#ifndef _ALPHA_UNISTD_H
-#define _ALPHA_UNISTD_H
-
-#define __NR_osf_syscall         0     /* not implemented */
-#define __NR_exit                1
-#define __NR_fork                2
-#define __NR_read                3
-#define __NR_write               4
-#define __NR_osf_old_open        5     /* not implemented */
-#define __NR_close               6
-#define __NR_osf_wait4           7
-#define __NR_osf_old_creat       8     /* not implemented */
-#define __NR_link                9
-#define __NR_unlink             10
-#define __NR_osf_execve                 11     /* not implemented */
-#define __NR_chdir              12
-#define __NR_fchdir             13
-#define __NR_mknod              14
-#define __NR_chmod              15
-#define __NR_chown              16
-#define __NR_brk                17
-#define __NR_osf_getfsstat      18     /* not implemented */
-#define __NR_lseek              19
-#define __NR_getxpid            20
-#define __NR_osf_mount          21
-#define __NR_umount             22
-#define __NR_setuid             23
-#define __NR_getxuid            24
-#define __NR_exec_with_loader   25     /* not implemented */
-#define __NR_ptrace             26
-#define __NR_osf_nrecvmsg       27     /* not implemented */
-#define __NR_osf_nsendmsg       28     /* not implemented */
-#define __NR_osf_nrecvfrom      29     /* not implemented */
-#define __NR_osf_naccept        30     /* not implemented */
-#define __NR_osf_ngetpeername   31     /* not implemented */
-#define __NR_osf_ngetsockname   32     /* not implemented */
-#define __NR_access             33
-#define __NR_osf_chflags        34     /* not implemented */
-#define __NR_osf_fchflags       35     /* not implemented */
-#define __NR_sync               36
-#define __NR_kill               37
-#define __NR_osf_old_stat       38     /* not implemented */
-#define __NR_setpgid            39
-#define __NR_osf_old_lstat      40     /* not implemented */
-#define __NR_dup                41
-#define __NR_pipe               42
-#define __NR_osf_set_program_attributes        43
-#define __NR_osf_profil                 44     /* not implemented */
-#define __NR_open               45
-#define __NR_osf_old_sigaction  46     /* not implemented */
-#define __NR_getxgid            47
-#define __NR_osf_sigprocmask    48
-#define __NR_osf_getlogin       49     /* not implemented */
-#define __NR_osf_setlogin       50     /* not implemented */
-#define __NR_acct               51
-#define __NR_sigpending                 52
-
-#define __NR_ioctl              54
-#define __NR_osf_reboot                 55     /* not implemented */
-#define __NR_osf_revoke                 56     /* not implemented */
-#define __NR_symlink            57
-#define __NR_readlink           58
-#define __NR_execve             59
-#define __NR_umask              60
-#define __NR_chroot             61
-#define __NR_osf_old_fstat      62     /* not implemented */
-#define __NR_getpgrp            63
-#define __NR_getpagesize        64
-#define __NR_osf_mremap                 65     /* not implemented */
-#define __NR_vfork              66
-#define __NR_stat               67
-#define __NR_lstat              68
-#define __NR_osf_sbrk           69     /* not implemented */
-#define __NR_osf_sstk           70     /* not implemented */
-#define __NR_mmap               71     /* OSF/1 mmap is superset of Linux */
-#define __NR_osf_old_vadvise    72     /* not implemented */
-#define __NR_munmap             73
-#define __NR_mprotect           74
-#define __NR_madvise            75
-#define __NR_vhangup            76
-#define __NR_osf_kmodcall       77     /* not implemented */
-#define __NR_osf_mincore        78     /* not implemented */
-#define __NR_getgroups          79
-#define __NR_setgroups          80
-#define __NR_osf_old_getpgrp    81     /* not implemented */
-#define __NR_setpgrp            82     /* BSD alias for setpgid */
-#define __NR_osf_setitimer      83
-#define __NR_osf_old_wait       84     /* not implemented */
-#define __NR_osf_table          85     /* not implemented */
-#define __NR_osf_getitimer      86
-#define __NR_gethostname        87
-#define __NR_sethostname        88
-#define __NR_getdtablesize      89
-#define __NR_dup2               90
-#define __NR_fstat              91
-#define __NR_fcntl              92
-#define __NR_osf_select                 93
-#define __NR_poll               94
-#define __NR_fsync              95
-#define __NR_setpriority        96
-#define __NR_socket             97
-#define __NR_connect            98
-#define __NR_accept             99
-#define __NR_getpriority       100
-#define __NR_send              101
-#define __NR_recv              102
-#define __NR_sigreturn         103
-#define __NR_bind              104
-#define __NR_setsockopt                105
-#define __NR_listen            106
-#define __NR_osf_plock         107     /* not implemented */
-#define __NR_osf_old_sigvec    108     /* not implemented */
-#define __NR_osf_old_sigblock  109     /* not implemented */
-#define __NR_osf_old_sigsetmask        110     /* not implemented */
-#define __NR_sigsuspend                111
-#define __NR_osf_sigstack      112
-#define __NR_recvmsg           113
-#define __NR_sendmsg           114
-#define __NR_osf_old_vtrace    115     /* not implemented */
-#define __NR_osf_gettimeofday  116
-#define __NR_osf_getrusage     117
-#define __NR_getsockopt                118
-
-#define __NR_readv             120
-#define __NR_writev            121
-#define __NR_osf_settimeofday  122
-#define __NR_fchown            123
-#define __NR_fchmod            124
-#define __NR_recvfrom          125
-#define __NR_setreuid          126
-#define __NR_setregid          127
-#define __NR_rename            128
-#define __NR_truncate          129
-#define __NR_ftruncate         130
-#define __NR_flock             131
-#define __NR_setgid            132
-#define __NR_sendto            133
-#define __NR_shutdown          134
-#define __NR_socketpair                135
-#define __NR_mkdir             136
-#define __NR_rmdir             137
-#define __NR_osf_utimes                138
-#define __NR_osf_old_sigreturn 139     /* not implemented */
-#define __NR_osf_adjtime       140     /* not implemented */
-#define __NR_getpeername       141
-#define __NR_osf_gethostid     142     /* not implemented */
-#define __NR_osf_sethostid     143     /* not implemented */
-#define __NR_getrlimit         144
-#define __NR_setrlimit         145
-#define __NR_osf_old_killpg    146     /* not implemented */
-#define __NR_setsid            147
-#define __NR_quotactl          148
-#define __NR_osf_oldquota      149     /* not implemented */
-#define __NR_getsockname       150
-
-#define __NR_osf_pid_block     153     /* not implemented */
-#define __NR_osf_pid_unblock   154     /* not implemented */
-
-#define __NR_sigaction         156
-#define __NR_osf_sigwaitprim   157     /* not implemented */
-#define __NR_osf_nfssvc                158     /* not implemented */
-#define __NR_osf_getdirentries 159
-#define __NR_osf_statfs                160
-#define __NR_osf_fstatfs       161
-
-#define __NR_osf_asynch_daemon 163     /* not implemented */
-#define __NR_osf_getfh         164     /* not implemented */   
-#define __NR_osf_getdomainname 165
-#define __NR_setdomainname     166
-
-#define __NR_osf_exportfs      169     /* not implemented */
-
-#define __NR_osf_alt_plock     181     /* not implemented */
-
-#define __NR_osf_getmnt                184     /* not implemented */
-
-#define __NR_osf_alt_sigpending        187     /* not implemented */
-#define __NR_osf_alt_setsid    188     /* not implemented */
-
-#define __NR_osf_swapon                199
-#define __NR_msgctl            200
-#define __NR_msgget            201
-#define __NR_msgrcv            202
-#define __NR_msgsnd            203
-#define __NR_semctl            204
-#define __NR_semget            205
-#define __NR_semop             206
-#define __NR_osf_utsname       207
-#define __NR_lchown            208
-#define __NR_osf_shmat         209
-#define __NR_shmctl            210
-#define __NR_shmdt             211
-#define __NR_shmget            212
-#define __NR_osf_mvalid                213     /* not implemented */
-#define __NR_osf_getaddressconf        214     /* not implemented */
-#define __NR_osf_msleep                215     /* not implemented */
-#define __NR_osf_mwakeup       216     /* not implemented */
-#define __NR_msync             217
-#define __NR_osf_signal                218     /* not implemented */
-#define __NR_osf_utc_gettime   219     /* not implemented */
-#define __NR_osf_utc_adjtime   220     /* not implemented */
-
-#define __NR_osf_security      222     /* not implemented */
-#define __NR_osf_kloadcall     223     /* not implemented */
-
-#define __NR_getpgid           233
-#define __NR_getsid            234
-#define __NR_sigaltstack       235
-#define __NR_osf_waitid                236     /* not implemented */
-#define __NR_osf_priocntlset   237     /* not implemented */
-#define __NR_osf_sigsendset    238     /* not implemented */
-#define __NR_osf_set_speculative       239     /* not implemented */
-#define __NR_osf_msfs_syscall  240     /* not implemented */
-#define __NR_osf_sysinfo       241
-#define __NR_osf_uadmin                242     /* not implemented */
-#define __NR_osf_fuser         243     /* not implemented */
-#define __NR_osf_proplist_syscall    244
-#define __NR_osf_ntp_adjtime   245     /* not implemented */
-#define __NR_osf_ntp_gettime   246     /* not implemented */
-#define __NR_osf_pathconf      247     /* not implemented */
-#define __NR_osf_fpathconf     248     /* not implemented */
-
-#define __NR_osf_uswitch       250     /* not implemented */
-#define __NR_osf_usleep_thread 251
-#define __NR_osf_audcntl       252     /* not implemented */
-#define __NR_osf_audgen                253     /* not implemented */
-#define __NR_sysfs             254
-#define __NR_osf_subsys_info   255     /* not implemented */
-#define __NR_osf_getsysinfo    256
-#define __NR_osf_setsysinfo    257
-#define __NR_osf_afs_syscall   258     /* not implemented */
-#define __NR_osf_swapctl       259     /* not implemented */
-#define __NR_osf_memcntl       260     /* not implemented */
-#define __NR_osf_fdatasync     261     /* not implemented */
-
-/*
- * Ignore legacy syscalls that we don't use.
- */
-#define __IGNORE_alarm
-#define __IGNORE_creat
-#define __IGNORE_getegid
-#define __IGNORE_geteuid
-#define __IGNORE_getgid
-#define __IGNORE_getpid
-#define __IGNORE_getppid
-#define __IGNORE_getuid
-#define __IGNORE_pause
-#define __IGNORE_time
-#define __IGNORE_utime
-
-/*
- * Linux-specific system calls begin at 300
- */
-#define __NR_bdflush           300
-#define __NR_sethae            301
-#define __NR_mount             302
-#define __NR_old_adjtimex      303
-#define __NR_swapoff           304
-#define __NR_getdents          305
-#define __NR_create_module     306
-#define __NR_init_module       307
-#define __NR_delete_module     308
-#define __NR_get_kernel_syms   309
-#define __NR_syslog            310
-#define __NR_reboot            311
-#define __NR_clone             312
-#define __NR_uselib            313
-#define __NR_mlock             314
-#define __NR_munlock           315
-#define __NR_mlockall          316
-#define __NR_munlockall                317
-#define __NR_sysinfo           318
-#define __NR__sysctl           319
-/* 320 was sys_idle.  */
-#define __NR_oldumount         321
-#define __NR_swapon            322
-#define __NR_times             323
-#define __NR_personality       324
-#define __NR_setfsuid          325
-#define __NR_setfsgid          326
-#define __NR_ustat             327
-#define __NR_statfs            328
-#define __NR_fstatfs           329
-#define __NR_sched_setparam            330
-#define __NR_sched_getparam            331
-#define __NR_sched_setscheduler                332
-#define __NR_sched_getscheduler                333
-#define __NR_sched_yield               334
-#define __NR_sched_get_priority_max    335
-#define __NR_sched_get_priority_min    336
-#define __NR_sched_rr_get_interval     337
-#define __NR_afs_syscall               338
-#define __NR_uname                     339
-#define __NR_nanosleep                 340
-#define __NR_mremap                    341
-#define __NR_nfsservctl                        342
-#define __NR_setresuid                 343
-#define __NR_getresuid                 344
-#define __NR_pciconfig_read            345
-#define __NR_pciconfig_write           346
-#define __NR_query_module              347
-#define __NR_prctl                     348
-#define __NR_pread64                   349
-#define __NR_pwrite64                  350
-#define __NR_rt_sigreturn              351
-#define __NR_rt_sigaction              352
-#define __NR_rt_sigprocmask            353
-#define __NR_rt_sigpending             354
-#define __NR_rt_sigtimedwait           355
-#define __NR_rt_sigqueueinfo           356
-#define __NR_rt_sigsuspend             357
-#define __NR_select                    358
-#define __NR_gettimeofday              359
-#define __NR_settimeofday              360
-#define __NR_getitimer                 361
-#define __NR_setitimer                 362
-#define __NR_utimes                    363
-#define __NR_getrusage                 364
-#define __NR_wait4                     365
-#define __NR_adjtimex                  366
-#define __NR_getcwd                    367
-#define __NR_capget                    368
-#define __NR_capset                    369
-#define __NR_sendfile                  370
-#define __NR_setresgid                 371
-#define __NR_getresgid                 372
-#define __NR_dipc                      373
-#define __NR_pivot_root                        374
-#define __NR_mincore                   375
-#define __NR_pciconfig_iobase          376
-#define __NR_getdents64                        377
-#define __NR_gettid                    378
-#define __NR_readahead                 379
-/* 380 is unused */
-#define __NR_tkill                     381
-#define __NR_setxattr                  382
-#define __NR_lsetxattr                 383
-#define __NR_fsetxattr                 384
-#define __NR_getxattr                  385
-#define __NR_lgetxattr                 386
-#define __NR_fgetxattr                 387
-#define __NR_listxattr                 388
-#define __NR_llistxattr                        389
-#define __NR_flistxattr                        390
-#define __NR_removexattr               391
-#define __NR_lremovexattr              392
-#define __NR_fremovexattr              393
-#define __NR_futex                     394
-#define __NR_sched_setaffinity         395     
-#define __NR_sched_getaffinity         396
-#define __NR_tuxcall                   397
-#define __NR_io_setup                  398
-#define __NR_io_destroy                        399
-#define __NR_io_getevents              400
-#define __NR_io_submit                 401
-#define __NR_io_cancel                 402
-#define __NR_exit_group                        405
-#define __NR_lookup_dcookie            406
-#define __NR_epoll_create              407
-#define __NR_epoll_ctl                 408
-#define __NR_epoll_wait                        409
-/* Feb 2007: These three sys_epoll defines shouldn't be here but culling
- * them would break userspace apps ... we'll kill them off in 2010 :) */
-#define __NR_sys_epoll_create          __NR_epoll_create
-#define __NR_sys_epoll_ctl             __NR_epoll_ctl
-#define __NR_sys_epoll_wait            __NR_epoll_wait
-#define __NR_remap_file_pages          410
-#define __NR_set_tid_address           411
-#define __NR_restart_syscall           412
-#define __NR_fadvise64                 413
-#define __NR_timer_create              414
-#define __NR_timer_settime             415
-#define __NR_timer_gettime             416
-#define __NR_timer_getoverrun          417
-#define __NR_timer_delete              418
-#define __NR_clock_settime             419
-#define __NR_clock_gettime             420
-#define __NR_clock_getres              421
-#define __NR_clock_nanosleep           422
-#define __NR_semtimedop                        423
-#define __NR_tgkill                    424
-#define __NR_stat64                    425
-#define __NR_lstat64                   426
-#define __NR_fstat64                   427
-#define __NR_vserver                   428
-#define __NR_mbind                     429
-#define __NR_get_mempolicy             430
-#define __NR_set_mempolicy             431
-#define __NR_mq_open                   432
-#define __NR_mq_unlink                 433
-#define __NR_mq_timedsend              434
-#define __NR_mq_timedreceive           435
-#define __NR_mq_notify                 436
-#define __NR_mq_getsetattr             437
-#define __NR_waitid                    438
-#define __NR_add_key                   439
-#define __NR_request_key               440
-#define __NR_keyctl                    441
-#define __NR_ioprio_set                        442
-#define __NR_ioprio_get                        443
-#define __NR_inotify_init              444
-#define __NR_inotify_add_watch         445
-#define __NR_inotify_rm_watch          446
-#define __NR_fdatasync                 447
-#define __NR_kexec_load                        448
-#define __NR_migrate_pages             449
-#define __NR_openat                    450
-#define __NR_mkdirat                   451
-#define __NR_mknodat                   452
-#define __NR_fchownat                  453
-#define __NR_futimesat                 454
-#define __NR_fstatat64                 455
-#define __NR_unlinkat                  456
-#define __NR_renameat                  457
-#define __NR_linkat                    458
-#define __NR_symlinkat                 459
-#define __NR_readlinkat                        460
-#define __NR_fchmodat                  461
-#define __NR_faccessat                 462
-#define __NR_pselect6                  463
-#define __NR_ppoll                     464
-#define __NR_unshare                   465
-#define __NR_set_robust_list           466
-#define __NR_get_robust_list           467
-#define __NR_splice                    468
-#define __NR_sync_file_range           469
-#define __NR_tee                       470
-#define __NR_vmsplice                  471
-#define __NR_move_pages                        472
-#define __NR_getcpu                    473
-#define __NR_epoll_pwait               474
-#define __NR_utimensat                 475
-#define __NR_signalfd                  476
-#define __NR_timerfd                   477
-#define __NR_eventfd                   478
-
-#ifdef __KERNEL__
-
-#define NR_SYSCALLS                    479
-
-#define __ARCH_WANT_IPC_PARSE_VERSION
-#define __ARCH_WANT_OLD_READDIR
-#define __ARCH_WANT_STAT64
-#define __ARCH_WANT_SYS_GETHOSTNAME
-#define __ARCH_WANT_SYS_FADVISE64
-#define __ARCH_WANT_SYS_GETPGRP
-#define __ARCH_WANT_SYS_OLD_GETRLIMIT
-#define __ARCH_WANT_SYS_OLDUMOUNT
-#define __ARCH_WANT_SYS_SIGPENDING
-
-/* "Conditional" syscalls.  What we want is
-
-       __attribute__((weak,alias("sys_ni_syscall")))
-
-   but that raises the problem of what type to give the symbol.  If we use
-   a prototype, it'll conflict with the definition given in this file and
-   others.  If we use __typeof, we discover that not all symbols actually
-   have declarations.  If we use no prototype, then we get warnings from
-   -Wstrict-prototypes.  Ho hum.  */
-
-#define cond_syscall(x)  asm(".weak\t" #x "\n" #x " = sys_ni_syscall")
-
-#endif /* __KERNEL__ */
-#endif /* _ALPHA_UNISTD_H */
diff --git a/include/asm-alpha/user.h b/include/asm-alpha/user.h
deleted file mode 100644 (file)
index a4eb6a4..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef _ALPHA_USER_H
-#define _ALPHA_USER_H
-
-#include <linux/sched.h>
-#include <linux/ptrace.h>
-
-#include <asm/page.h>
-#include <asm/reg.h>
-
-/*
- * Core file format: The core file is written in such a way that gdb
- * can understand it and provide useful information to the user (under
- * linux we use the `trad-core' bfd, NOT the osf-core).  The file contents
- * are as follows:
- *
- *  upage: 1 page consisting of a user struct that tells gdb
- *     what is present in the file.  Directly after this is a
- *     copy of the task_struct, which is currently not used by gdb,
- *     but it may come in handy at some point.  All of the registers
- *     are stored as part of the upage.  The upage should always be
- *     only one page long.
- *  data: The data segment follows next.  We use current->end_text to
- *     current->brk to pick up all of the user variables, plus any memory
- *     that may have been sbrk'ed.  No attempt is made to determine if a
- *     page is demand-zero or if a page is totally unused, we just cover
- *     the entire range.  All of the addresses are rounded in such a way
- *     that an integral number of pages is written.
- *  stack: We need the stack information in order to get a meaningful
- *     backtrace.  We need to write the data from usp to
- *     current->start_stack, so we round each of these in order to be able
- *     to write an integer number of pages.
- */
-struct user {
-       unsigned long   regs[EF_SIZE/8+32];     /* integer and fp regs */
-       size_t          u_tsize;                /* text size (pages) */
-       size_t          u_dsize;                /* data size (pages) */
-       size_t          u_ssize;                /* stack size (pages) */
-       unsigned long   start_code;             /* text starting address */
-       unsigned long   start_data;             /* data starting address */
-       unsigned long   start_stack;            /* stack starting address */
-       long int        signal;                 /* signal causing core dump */
-       unsigned long   u_ar0;                  /* help gdb find registers */
-       unsigned long   magic;                  /* identifies a core file */
-       char            u_comm[32];             /* user command name */
-};
-
-#define NBPG                   PAGE_SIZE
-#define UPAGES                 1
-#define HOST_TEXT_START_ADDR   (u.start_code)
-#define HOST_DATA_START_ADDR   (u.start_data)
-#define HOST_STACK_END_ADDR    (u.start_stack + u.u_ssize * NBPG)
-
-#endif /* _ALPHA_USER_H */
diff --git a/include/asm-alpha/vga.h b/include/asm-alpha/vga.h
deleted file mode 100644 (file)
index c00106b..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- *     Access to VGA videoram
- *
- *     (c) 1998 Martin Mares <mj@ucw.cz>
- */
-
-#ifndef _LINUX_ASM_VGA_H_
-#define _LINUX_ASM_VGA_H_
-
-#include <asm/io.h>
-
-#define VT_BUF_HAVE_RW
-#define VT_BUF_HAVE_MEMSETW
-#define VT_BUF_HAVE_MEMCPYW
-
-static inline void scr_writew(u16 val, volatile u16 *addr)
-{
-       if (__is_ioaddr(addr))
-               __raw_writew(val, (volatile u16 __iomem *) addr);
-       else
-               *addr = val;
-}
-
-static inline u16 scr_readw(volatile const u16 *addr)
-{
-       if (__is_ioaddr(addr))
-               return __raw_readw((volatile const u16 __iomem *) addr);
-       else
-               return *addr;
-}
-
-static inline void scr_memsetw(u16 *s, u16 c, unsigned int count)
-{
-       if (__is_ioaddr(s))
-               memsetw_io((u16 __iomem *) s, c, count);
-       else
-               memsetw(s, c, count);
-}
-
-/* Do not trust that the usage will be correct; analyze the arguments.  */
-extern void scr_memcpyw(u16 *d, const u16 *s, unsigned int count);
-
-/* ??? These are currently only used for downloading character sets.  As
-   such, they don't need memory barriers.  Is this all they are intended
-   to be used for?  */
-#define vga_readb(a)   readb((u8 __iomem *)(a))
-#define vga_writeb(v,a)        writeb(v, (u8 __iomem *)(a))
-
-#ifdef CONFIG_VGA_HOSE
-#include <linux/ioport.h>
-#include <linux/pci.h>
-
-extern struct pci_controller *pci_vga_hose;
-
-# define __is_port_vga(a)       \
-       (((a) >= 0x3b0) && ((a) < 0x3e0) && \
-        ((a) != 0x3b3) && ((a) != 0x3d3))
-
-# define __is_mem_vga(a) \
-       (((a) >= 0xa0000) && ((a) <= 0xc0000))
-
-# define FIXUP_IOADDR_VGA(a) do {                       \
-       if (pci_vga_hose && __is_port_vga(a))     \
-               (a) += pci_vga_hose->io_space->start;     \
- } while(0)
-
-# define FIXUP_MEMADDR_VGA(a) do {                       \
-       if (pci_vga_hose && __is_mem_vga(a))     \
-               (a) += pci_vga_hose->mem_space->start; \
- } while(0)
-
-#else /* CONFIG_VGA_HOSE */
-# define pci_vga_hose 0
-# define __is_port_vga(a) 0
-# define __is_mem_vga(a) 0
-# define FIXUP_IOADDR_VGA(a)
-# define FIXUP_MEMADDR_VGA(a)
-#endif /* CONFIG_VGA_HOSE */
-
-#define VGA_MAP_MEM(x,s)       ((unsigned long) ioremap(x, s))
-
-#endif
diff --git a/include/asm-alpha/xor.h b/include/asm-alpha/xor.h
deleted file mode 100644 (file)
index 5ee1c2b..0000000
+++ /dev/null
@@ -1,855 +0,0 @@
-/*
- * include/asm-alpha/xor.h
- *
- * Optimized RAID-5 checksumming functions for alpha EV5 and EV6
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * You should have received a copy of the GNU General Public License
- * (for example /usr/src/linux/COPYING); if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-extern void xor_alpha_2(unsigned long, unsigned long *, unsigned long *);
-extern void xor_alpha_3(unsigned long, unsigned long *, unsigned long *,
-                       unsigned long *);
-extern void xor_alpha_4(unsigned long, unsigned long *, unsigned long *,
-                       unsigned long *, unsigned long *);
-extern void xor_alpha_5(unsigned long, unsigned long *, unsigned long *,
-                       unsigned long *, unsigned long *, unsigned long *);
-
-extern void xor_alpha_prefetch_2(unsigned long, unsigned long *,
-                                unsigned long *);
-extern void xor_alpha_prefetch_3(unsigned long, unsigned long *,
-                                unsigned long *, unsigned long *);
-extern void xor_alpha_prefetch_4(unsigned long, unsigned long *,
-                                unsigned long *, unsigned long *,
-                                unsigned long *);
-extern void xor_alpha_prefetch_5(unsigned long, unsigned long *,
-                                unsigned long *, unsigned long *,
-                                unsigned long *, unsigned long *);
-
-asm("                                                          \n\
-       .text                                                   \n\
-       .align 3                                                \n\
-       .ent xor_alpha_2                                        \n\
-xor_alpha_2:                                                   \n\
-       .prologue 0                                             \n\
-       srl $16, 6, $16                                         \n\
-       .align 4                                                \n\
-2:                                                             \n\
-       ldq $0,0($17)                                           \n\
-       ldq $1,0($18)                                           \n\
-       ldq $2,8($17)                                           \n\
-       ldq $3,8($18)                                           \n\
-                                                               \n\
-       ldq $4,16($17)                                          \n\
-       ldq $5,16($18)                                          \n\
-       ldq $6,24($17)                                          \n\
-       ldq $7,24($18)                                          \n\
-                                                               \n\
-       ldq $19,32($17)                                         \n\
-       ldq $20,32($18)                                         \n\
-       ldq $21,40($17)                                         \n\
-       ldq $22,40($18)                                         \n\
-                                                               \n\
-       ldq $23,48($17)                                         \n\
-       ldq $24,48($18)                                         \n\
-       ldq $25,56($17)                                         \n\
-       xor $0,$1,$0            # 7 cycles from $1 load         \n\
-                                                               \n\
-       ldq $27,56($18)                                         \n\
-       xor $2,$3,$2                                            \n\
-       stq $0,0($17)                                           \n\
-       xor $4,$5,$4                                            \n\
-                                                               \n\
-       stq $2,8($17)                                           \n\
-       xor $6,$7,$6                                            \n\
-       stq $4,16($17)                                          \n\
-       xor $19,$20,$19                                         \n\
-                                                               \n\
-       stq $6,24($17)                                          \n\
-       xor $21,$22,$21                                         \n\
-       stq $19,32($17)                                         \n\
-       xor $23,$24,$23                                         \n\
-                                                               \n\
-       stq $21,40($17)                                         \n\
-       xor $25,$27,$25                                         \n\
-       stq $23,48($17)                                         \n\
-       subq $16,1,$16                                          \n\
-                                                               \n\
-       stq $25,56($17)                                         \n\
-       addq $17,64,$17                                         \n\
-       addq $18,64,$18                                         \n\
-       bgt $16,2b                                              \n\
-                                                               \n\
-       ret                                                     \n\
-       .end xor_alpha_2                                        \n\
-                                                               \n\
-       .align 3                                                \n\
-       .ent xor_alpha_3                                        \n\
-xor_alpha_3:                                                   \n\
-       .prologue 0                                             \n\
-       srl $16, 6, $16                                         \n\
-       .align 4                                                \n\
-3:                                                             \n\
-       ldq $0,0($17)                                           \n\
-       ldq $1,0($18)                                           \n\
-       ldq $2,0($19)                                           \n\
-       ldq $3,8($17)                                           \n\
-                                                               \n\
-       ldq $4,8($18)                                           \n\
-       ldq $6,16($17)                                          \n\
-       ldq $7,16($18)                                          \n\
-       ldq $21,24($17)                                         \n\
-                                                               \n\
-       ldq $22,24($18)                                         \n\
-       ldq $24,32($17)                                         \n\
-       ldq $25,32($18)                                         \n\
-       ldq $5,8($19)                                           \n\
-                                                               \n\
-       ldq $20,16($19)                                         \n\
-       ldq $23,24($19)                                         \n\
-       ldq $27,32($19)                                         \n\
-       nop                                                     \n\
-                                                               \n\
-       xor $0,$1,$1            # 8 cycles from $0 load         \n\
-       xor $3,$4,$4            # 6 cycles from $4 load         \n\
-       xor $6,$7,$7            # 6 cycles from $7 load         \n\
-       xor $21,$22,$22         # 5 cycles from $22 load        \n\
-                                                               \n\
-       xor $1,$2,$2            # 9 cycles from $2 load         \n\
-       xor $24,$25,$25         # 5 cycles from $25 load        \n\
-       stq $2,0($17)                                           \n\
-       xor $4,$5,$5            # 6 cycles from $5 load         \n\
-                                                               \n\
-       stq $5,8($17)                                           \n\
-       xor $7,$20,$20          # 7 cycles from $20 load        \n\
-       stq $20,16($17)                                         \n\
-       xor $22,$23,$23         # 7 cycles from $23 load        \n\
-                                                               \n\
-       stq $23,24($17)                                         \n\
-       xor $25,$27,$27         # 7 cycles from $27 load        \n\
-       stq $27,32($17)                                         \n\
-       nop                                                     \n\
-                                                               \n\
-       ldq $0,40($17)                                          \n\
-       ldq $1,40($18)                                          \n\
-       ldq $3,48($17)                                          \n\
-       ldq $4,48($18)                                          \n\
-                                                               \n\
-       ldq $6,56($17)                                          \n\
-       ldq $7,56($18)                                          \n\
-       ldq $2,40($19)                                          \n\
-       ldq $5,48($19)                                          \n\
-                                                               \n\
-       ldq $20,56($19)                                         \n\
-       xor $0,$1,$1            # 4 cycles from $1 load         \n\
-       xor $3,$4,$4            # 5 cycles from $4 load         \n\
-       xor $6,$7,$7            # 5 cycles from $7 load         \n\
-                                                               \n\
-       xor $1,$2,$2            # 4 cycles from $2 load         \n\
-       xor $4,$5,$5            # 5 cycles from $5 load         \n\
-       stq $2,40($17)                                          \n\
-       xor $7,$20,$20          # 4 cycles from $20 load        \n\
-                                                               \n\
-       stq $5,48($17)                                          \n\
-       subq $16,1,$16                                          \n\
-       stq $20,56($17)                                         \n\
-       addq $19,64,$19                                         \n\
-                                                               \n\
-       addq $18,64,$18                                         \n\
-       addq $17,64,$17                                         \n\
-       bgt $16,3b                                              \n\
-       ret                                                     \n\
-       .end xor_alpha_3                                        \n\
-                                                               \n\
-       .align 3                                                \n\
-       .ent xor_alpha_4                                        \n\
-xor_alpha_4:                                                   \n\
-       .prologue 0                                             \n\
-       srl $16, 6, $16                                         \n\
-       .align 4                                                \n\
-4:                                                             \n\
-       ldq $0,0($17)                                           \n\
-       ldq $1,0($18)                                           \n\
-       ldq $2,0($19)                                           \n\
-       ldq $3,0($20)                                           \n\
-                                                               \n\
-       ldq $4,8($17)                                           \n\
-       ldq $5,8($18)                                           \n\
-       ldq $6,8($19)                                           \n\
-       ldq $7,8($20)                                           \n\
-                                                               \n\
-       ldq $21,16($17)                                         \n\
-       ldq $22,16($18)                                         \n\
-       ldq $23,16($19)                                         \n\
-       ldq $24,16($20)                                         \n\
-                                                               \n\
-       ldq $25,24($17)                                         \n\
-       xor $0,$1,$1            # 6 cycles from $1 load         \n\
-       ldq $27,24($18)                                         \n\
-       xor $2,$3,$3            # 6 cycles from $3 load         \n\
-                                                               \n\
-       ldq $0,24($19)                                          \n\
-       xor $1,$3,$3                                            \n\
-       ldq $1,24($20)                                          \n\
-       xor $4,$5,$5            # 7 cycles from $5 load         \n\
-                                                               \n\
-       stq $3,0($17)                                           \n\
-       xor $6,$7,$7                                            \n\
-       xor $21,$22,$22         # 7 cycles from $22 load        \n\
-       xor $5,$7,$7                                            \n\
-                                                               \n\
-       stq $7,8($17)                                           \n\
-       xor $23,$24,$24         # 7 cycles from $24 load        \n\
-       ldq $2,32($17)                                          \n\
-       xor $22,$24,$24                                         \n\
-                                                               \n\
-       ldq $3,32($18)                                          \n\
-       ldq $4,32($19)                                          \n\
-       ldq $5,32($20)                                          \n\
-       xor $25,$27,$27         # 8 cycles from $27 load        \n\
-                                                               \n\
-       ldq $6,40($17)                                          \n\
-       ldq $7,40($18)                                          \n\
-       ldq $21,40($19)                                         \n\
-       ldq $22,40($20)                                         \n\
-                                                               \n\
-       stq $24,16($17)                                         \n\
-       xor $0,$1,$1            # 9 cycles from $1 load         \n\
-       xor $2,$3,$3            # 5 cycles from $3 load         \n\
-       xor $27,$1,$1                                           \n\
-                                                               \n\
-       stq $1,24($17)                                          \n\
-       xor $4,$5,$5            # 5 cycles from $5 load         \n\
-       ldq $23,48($17)                                         \n\
-       ldq $24,48($18)                                         \n\
-                                                               \n\
-       ldq $25,48($19)                                         \n\
-       xor $3,$5,$5                                            \n\
-       ldq $27,48($20)                                         \n\
-       ldq $0,56($17)                                          \n\
-                                                               \n\
-       ldq $1,56($18)                                          \n\
-       ldq $2,56($19)                                          \n\
-       xor $6,$7,$7            # 8 cycles from $6 load         \n\
-       ldq $3,56($20)                                          \n\
-                                                               \n\
-       stq $5,32($17)                                          \n\
-       xor $21,$22,$22         # 8 cycles from $22 load        \n\
-       xor $7,$22,$22                                          \n\
-       xor $23,$24,$24         # 5 cycles from $24 load        \n\
-                                                               \n\
-       stq $22,40($17)                                         \n\
-       xor $25,$27,$27         # 5 cycles from $27 load        \n\
-       xor $24,$27,$27                                         \n\
-       xor $0,$1,$1            # 5 cycles from $1 load         \n\
-                                                               \n\
-       stq $27,48($17)                                         \n\
-       xor $2,$3,$3            # 4 cycles from $3 load         \n\
-       xor $1,$3,$3                                            \n\
-       subq $16,1,$16                                          \n\
-                                                               \n\
-       stq $3,56($17)                                          \n\
-       addq $20,64,$20                                         \n\
-       addq $19,64,$19                                         \n\
-       addq $18,64,$18                                         \n\
-                                                               \n\
-       addq $17,64,$17                                         \n\
-       bgt $16,4b                                              \n\
-       ret                                                     \n\
-       .end xor_alpha_4                                        \n\
-                                                               \n\
-       .align 3                                                \n\
-       .ent xor_alpha_5                                        \n\
-xor_alpha_5:                                                   \n\
-       .prologue 0                                             \n\
-       srl $16, 6, $16                                         \n\
-       .align 4                                                \n\
-5:                                                             \n\
-       ldq $0,0($17)                                           \n\
-       ldq $1,0($18)                                           \n\
-       ldq $2,0($19)                                           \n\
-       ldq $3,0($20)                                           \n\
-                                                               \n\
-       ldq $4,0($21)                                           \n\
-       ldq $5,8($17)                                           \n\
-       ldq $6,8($18)                                           \n\
-       ldq $7,8($19)                                           \n\
-                                                               \n\
-       ldq $22,8($20)                                          \n\
-       ldq $23,8($21)                                          \n\
-       ldq $24,16($17)                                         \n\
-       ldq $25,16($18)                                         \n\
-                                                               \n\
-       ldq $27,16($19)                                         \n\
-       xor $0,$1,$1            # 6 cycles from $1 load         \n\
-       ldq $28,16($20)                                         \n\
-       xor $2,$3,$3            # 6 cycles from $3 load         \n\
-                                                               \n\
-       ldq $0,16($21)                                          \n\
-       xor $1,$3,$3                                            \n\
-       ldq $1,24($17)                                          \n\
-       xor $3,$4,$4            # 7 cycles from $4 load         \n\
-                                                               \n\
-       stq $4,0($17)                                           \n\
-       xor $5,$6,$6            # 7 cycles from $6 load         \n\
-       xor $7,$22,$22          # 7 cycles from $22 load        \n\
-       xor $6,$23,$23          # 7 cycles from $23 load        \n\
-                                                               \n\
-       ldq $2,24($18)                                          \n\
-       xor $22,$23,$23                                         \n\
-       ldq $3,24($19)                                          \n\
-       xor $24,$25,$25         # 8 cycles from $25 load        \n\
-                                                               \n\
-       stq $23,8($17)                                          \n\
-       xor $25,$27,$27         # 8 cycles from $27 load        \n\
-       ldq $4,24($20)                                          \n\
-       xor $28,$0,$0           # 7 cycles from $0 load         \n\
-                                                               \n\
-       ldq $5,24($21)                                          \n\
-       xor $27,$0,$0                                           \n\
-       ldq $6,32($17)                                          \n\
-       ldq $7,32($18)                                          \n\
-                                                               \n\
-       stq $0,16($17)                                          \n\
-       xor $1,$2,$2            # 6 cycles from $2 load         \n\
-       ldq $22,32($19)                                         \n\
-       xor $3,$4,$4            # 4 cycles from $4 load         \n\
-                                                               \n\
-       ldq $23,32($20)                                         \n\
-       xor $2,$4,$4                                            \n\
-       ldq $24,32($21)                                         \n\
-       ldq $25,40($17)                                         \n\
-                                                               \n\
-       ldq $27,40($18)                                         \n\
-       ldq $28,40($19)                                         \n\
-       ldq $0,40($20)                                          \n\
-       xor $4,$5,$5            # 7 cycles from $5 load         \n\
-                                                               \n\
-       stq $5,24($17)                                          \n\
-       xor $6,$7,$7            # 7 cycles from $7 load         \n\
-       ldq $1,40($21)                                          \n\
-       ldq $2,48($17)                                          \n\
-                                                               \n\
-       ldq $3,48($18)                                          \n\
-       xor $7,$22,$22          # 7 cycles from $22 load        \n\
-       ldq $4,48($19)                                          \n\
-       xor $23,$24,$24         # 6 cycles from $24 load        \n\
-                                                               \n\
-       ldq $5,48($20)                                          \n\
-       xor $22,$24,$24                                         \n\
-       ldq $6,48($21)                                          \n\
-       xor $25,$27,$27         # 7 cycles from $27 load        \n\
-                                                               \n\
-       stq $24,32($17)                                         \n\
-       xor $27,$28,$28         # 8 cycles from $28 load        \n\
-       ldq $7,56($17)                                          \n\
-       xor $0,$1,$1            # 6 cycles from $1 load         \n\
-                                                               \n\
-       ldq $22,56($18)                                         \n\
-       ldq $23,56($19)                                         \n\
-       ldq $24,56($20)                                         \n\
-       ldq $25,56($21)                                         \n\
-                                                               \n\
-       xor $28,$1,$1                                           \n\
-       xor $2,$3,$3            # 9 cycles from $3 load         \n\
-       xor $3,$4,$4            # 9 cycles from $4 load         \n\
-       xor $5,$6,$6            # 8 cycles from $6 load         \n\
-                                                               \n\
-       stq $1,40($17)                                          \n\
-       xor $4,$6,$6                                            \n\
-       xor $7,$22,$22          # 7 cycles from $22 load        \n\
-       xor $23,$24,$24         # 6 cycles from $24 load        \n\
-                                                               \n\
-       stq $6,48($17)                                          \n\
-       xor $22,$24,$24                                         \n\
-       subq $16,1,$16                                          \n\
-       xor $24,$25,$25         # 8 cycles from $25 load        \n\
-                                                               \n\
-       stq $25,56($17)                                         \n\
-       addq $21,64,$21                                         \n\
-       addq $20,64,$20                                         \n\
-       addq $19,64,$19                                         \n\
-                                                               \n\
-       addq $18,64,$18                                         \n\
-       addq $17,64,$17                                         \n\
-       bgt $16,5b                                              \n\
-       ret                                                     \n\
-       .end xor_alpha_5                                        \n\
-                                                               \n\
-       .align 3                                                \n\
-       .ent xor_alpha_prefetch_2                               \n\
-xor_alpha_prefetch_2:                                          \n\
-       .prologue 0                                             \n\
-       srl $16, 6, $16                                         \n\
-                                                               \n\
-       ldq $31, 0($17)                                         \n\
-       ldq $31, 0($18)                                         \n\
-                                                               \n\
-       ldq $31, 64($17)                                        \n\
-       ldq $31, 64($18)                                        \n\
-                                                               \n\
-       ldq $31, 128($17)                                       \n\
-       ldq $31, 128($18)                                       \n\
-                                                               \n\
-       ldq $31, 192($17)                                       \n\
-       ldq $31, 192($18)                                       \n\
-       .align 4                                                \n\
-2:                                                             \n\
-       ldq $0,0($17)                                           \n\
-       ldq $1,0($18)                                           \n\
-       ldq $2,8($17)                                           \n\
-       ldq $3,8($18)                                           \n\
-                                                               \n\
-       ldq $4,16($17)                                          \n\
-       ldq $5,16($18)                                          \n\
-       ldq $6,24($17)                                          \n\
-       ldq $7,24($18)                                          \n\
-                                                               \n\
-       ldq $19,32($17)                                         \n\
-       ldq $20,32($18)                                         \n\
-       ldq $21,40($17)                                         \n\
-       ldq $22,40($18)                                         \n\
-                                                               \n\
-       ldq $23,48($17)                                         \n\
-       ldq $24,48($18)                                         \n\
-       ldq $25,56($17)                                         \n\
-       ldq $27,56($18)                                         \n\
-                                                               \n\
-       ldq $31,256($17)                                        \n\
-       xor $0,$1,$0            # 8 cycles from $1 load         \n\
-       ldq $31,256($18)                                        \n\
-       xor $2,$3,$2                                            \n\
-                                                               \n\
-       stq $0,0($17)                                           \n\
-       xor $4,$5,$4                                            \n\
-       stq $2,8($17)                                           \n\
-       xor $6,$7,$6                                            \n\
-                                                               \n\
-       stq $4,16($17)                                          \n\
-       xor $19,$20,$19                                         \n\
-       stq $6,24($17)                                          \n\
-       xor $21,$22,$21                                         \n\
-                                                               \n\
-       stq $19,32($17)                                         \n\
-       xor $23,$24,$23                                         \n\
-       stq $21,40($17)                                         \n\
-       xor $25,$27,$25                                         \n\
-                                                               \n\
-       stq $23,48($17)                                         \n\
-       subq $16,1,$16                                          \n\
-       stq $25,56($17)                                         \n\
-       addq $17,64,$17                                         \n\
-                                                               \n\
-       addq $18,64,$18                                         \n\
-       bgt $16,2b                                              \n\
-       ret                                                     \n\
-       .end xor_alpha_prefetch_2                               \n\
-                                                               \n\
-       .align 3                                                \n\
-       .ent xor_alpha_prefetch_3                               \n\
-xor_alpha_prefetch_3:                                          \n\
-       .prologue 0                                             \n\
-       srl $16, 6, $16                                         \n\
-                                                               \n\
-       ldq $31, 0($17)                                         \n\
-       ldq $31, 0($18)                                         \n\
-       ldq $31, 0($19)                                         \n\
-                                                               \n\
-       ldq $31, 64($17)                                        \n\
-       ldq $31, 64($18)                                        \n\
-       ldq $31, 64($19)                                        \n\
-                                                               \n\
-       ldq $31, 128($17)                                       \n\
-       ldq $31, 128($18)                                       \n\
-       ldq $31, 128($19)                                       \n\
-                                                               \n\
-       ldq $31, 192($17)                                       \n\
-       ldq $31, 192($18)                                       \n\
-       ldq $31, 192($19)                                       \n\
-       .align 4                                                \n\
-3:                                                             \n\
-       ldq $0,0($17)                                           \n\
-       ldq $1,0($18)                                           \n\
-       ldq $2,0($19)                                           \n\
-       ldq $3,8($17)                                           \n\
-                                                               \n\
-       ldq $4,8($18)                                           \n\
-       ldq $6,16($17)                                          \n\
-       ldq $7,16($18)                                          \n\
-       ldq $21,24($17)                                         \n\
-                                                               \n\
-       ldq $22,24($18)                                         \n\
-       ldq $24,32($17)                                         \n\
-       ldq $25,32($18)                                         \n\
-       ldq $5,8($19)                                           \n\
-                                                               \n\
-       ldq $20,16($19)                                         \n\
-       ldq $23,24($19)                                         \n\
-       ldq $27,32($19)                                         \n\
-       nop                                                     \n\
-                                                               \n\
-       xor $0,$1,$1            # 8 cycles from $0 load         \n\
-       xor $3,$4,$4            # 7 cycles from $4 load         \n\
-       xor $6,$7,$7            # 6 cycles from $7 load         \n\
-       xor $21,$22,$22         # 5 cycles from $22 load        \n\
-                                                               \n\
-       xor $1,$2,$2            # 9 cycles from $2 load         \n\
-       xor $24,$25,$25         # 5 cycles from $25 load        \n\
-       stq $2,0($17)                                           \n\
-       xor $4,$5,$5            # 6 cycles from $5 load         \n\
-                                                               \n\
-       stq $5,8($17)                                           \n\
-       xor $7,$20,$20          # 7 cycles from $20 load        \n\
-       stq $20,16($17)                                         \n\
-       xor $22,$23,$23         # 7 cycles from $23 load        \n\
-                                                               \n\
-       stq $23,24($17)                                         \n\
-       xor $25,$27,$27         # 7 cycles from $27 load        \n\
-       stq $27,32($17)                                         \n\
-       nop                                                     \n\
-                                                               \n\
-       ldq $0,40($17)                                          \n\
-       ldq $1,40($18)                                          \n\
-       ldq $3,48($17)                                          \n\
-       ldq $4,48($18)                                          \n\
-                                                               \n\
-       ldq $6,56($17)                                          \n\
-       ldq $7,56($18)                                          \n\
-       ldq $2,40($19)                                          \n\
-       ldq $5,48($19)                                          \n\
-                                                               \n\
-       ldq $20,56($19)                                         \n\
-       ldq $31,256($17)                                        \n\
-       ldq $31,256($18)                                        \n\
-       ldq $31,256($19)                                        \n\
-                                                               \n\
-       xor $0,$1,$1            # 6 cycles from $1 load         \n\
-       xor $3,$4,$4            # 5 cycles from $4 load         \n\
-       xor $6,$7,$7            # 5 cycles from $7 load         \n\
-       xor $1,$2,$2            # 4 cycles from $2 load         \n\
-                                                               \n\
-       xor $4,$5,$5            # 5 cycles from $5 load         \n\
-       xor $7,$20,$20          # 4 cycles from $20 load        \n\
-       stq $2,40($17)                                          \n\
-       subq $16,1,$16                                          \n\
-                                                               \n\
-       stq $5,48($17)                                          \n\
-       addq $19,64,$19                                         \n\
-       stq $20,56($17)                                         \n\
-       addq $18,64,$18                                         \n\
-                                                               \n\
-       addq $17,64,$17                                         \n\
-       bgt $16,3b                                              \n\
-       ret                                                     \n\
-       .end xor_alpha_prefetch_3                               \n\
-                                                               \n\
-       .align 3                                                \n\
-       .ent xor_alpha_prefetch_4                               \n\
-xor_alpha_prefetch_4:                                          \n\
-       .prologue 0                                             \n\
-       srl $16, 6, $16                                         \n\
-                                                               \n\
-       ldq $31, 0($17)                                         \n\
-       ldq $31, 0($18)                                         \n\
-       ldq $31, 0($19)                                         \n\
-       ldq $31, 0($20)                                         \n\
-                                                               \n\
-       ldq $31, 64($17)                                        \n\
-       ldq $31, 64($18)                                        \n\
-       ldq $31, 64($19)                                        \n\
-       ldq $31, 64($20)                                        \n\
-                                                               \n\
-       ldq $31, 128($17)                                       \n\
-       ldq $31, 128($18)                                       \n\
-       ldq $31, 128($19)                                       \n\
-       ldq $31, 128($20)                                       \n\
-                                                               \n\
-       ldq $31, 192($17)                                       \n\
-       ldq $31, 192($18)                                       \n\
-       ldq $31, 192($19)                                       \n\
-       ldq $31, 192($20)                                       \n\
-       .align 4                                                \n\
-4:                                                             \n\
-       ldq $0,0($17)                                           \n\
-       ldq $1,0($18)                                           \n\
-       ldq $2,0($19)                                           \n\
-       ldq $3,0($20)                                           \n\
-                                                               \n\
-       ldq $4,8($17)                                           \n\
-       ldq $5,8($18)                                           \n\
-       ldq $6,8($19)                                           \n\
-       ldq $7,8($20)                                           \n\
-                                                               \n\
-       ldq $21,16($17)                                         \n\
-       ldq $22,16($18)                                         \n\
-       ldq $23,16($19)                                         \n\
-       ldq $24,16($20)                                         \n\
-                                                               \n\
-       ldq $25,24($17)                                         \n\
-       xor $0,$1,$1            # 6 cycles from $1 load         \n\
-       ldq $27,24($18)                                         \n\
-       xor $2,$3,$3            # 6 cycles from $3 load         \n\
-                                                               \n\
-       ldq $0,24($19)                                          \n\
-       xor $1,$3,$3                                            \n\
-       ldq $1,24($20)                                          \n\
-       xor $4,$5,$5            # 7 cycles from $5 load         \n\
-                                                               \n\
-       stq $3,0($17)                                           \n\
-       xor $6,$7,$7                                            \n\
-       xor $21,$22,$22         # 7 cycles from $22 load        \n\
-       xor $5,$7,$7                                            \n\
-                                                               \n\
-       stq $7,8($17)                                           \n\
-       xor $23,$24,$24         # 7 cycles from $24 load        \n\
-       ldq $2,32($17)                                          \n\
-       xor $22,$24,$24                                         \n\
-                                                               \n\
-       ldq $3,32($18)                                          \n\
-       ldq $4,32($19)                                          \n\
-       ldq $5,32($20)                                          \n\
-       xor $25,$27,$27         # 8 cycles from $27 load        \n\
-                                                               \n\
-       ldq $6,40($17)                                          \n\
-       ldq $7,40($18)                                          \n\
-       ldq $21,40($19)                                         \n\
-       ldq $22,40($20)                                         \n\
-                                                               \n\
-       stq $24,16($17)                                         \n\
-       xor $0,$1,$1            # 9 cycles from $1 load         \n\
-       xor $2,$3,$3            # 5 cycles from $3 load         \n\
-       xor $27,$1,$1                                           \n\
-                                                               \n\
-       stq $1,24($17)                                          \n\
-       xor $4,$5,$5            # 5 cycles from $5 load         \n\
-       ldq $23,48($17)                                         \n\
-       xor $3,$5,$5                                            \n\
-                                                               \n\
-       ldq $24,48($18)                                         \n\
-       ldq $25,48($19)                                         \n\
-       ldq $27,48($20)                                         \n\
-       ldq $0,56($17)                                          \n\
-                                                               \n\
-       ldq $1,56($18)                                          \n\
-       ldq $2,56($19)                                          \n\
-       ldq $3,56($20)                                          \n\
-       xor $6,$7,$7            # 8 cycles from $6 load         \n\
-                                                               \n\
-       ldq $31,256($17)                                        \n\
-       xor $21,$22,$22         # 8 cycles from $22 load        \n\
-       ldq $31,256($18)                                        \n\
-       xor $7,$22,$22                                          \n\
-                                                               \n\
-       ldq $31,256($19)                                        \n\
-       xor $23,$24,$24         # 6 cycles from $24 load        \n\
-       ldq $31,256($20)                                        \n\
-       xor $25,$27,$27         # 6 cycles from $27 load        \n\
-                                                               \n\
-       stq $5,32($17)                                          \n\
-       xor $24,$27,$27                                         \n\
-       xor $0,$1,$1            # 7 cycles from $1 load         \n\
-       xor $2,$3,$3            # 6 cycles from $3 load         \n\
-                                                               \n\
-       stq $22,40($17)                                         \n\
-       xor $1,$3,$3                                            \n\
-       stq $27,48($17)                                         \n\
-       subq $16,1,$16                                          \n\
-                                                               \n\
-       stq $3,56($17)                                          \n\
-       addq $20,64,$20                                         \n\
-       addq $19,64,$19                                         \n\
-       addq $18,64,$18                                         \n\
-                                                               \n\
-       addq $17,64,$17                                         \n\
-       bgt $16,4b                                              \n\
-       ret                                                     \n\
-       .end xor_alpha_prefetch_4                               \n\
-                                                               \n\
-       .align 3                                                \n\
-       .ent xor_alpha_prefetch_5                               \n\
-xor_alpha_prefetch_5:                                          \n\
-       .prologue 0                                             \n\
-       srl $16, 6, $16                                         \n\
-                                                               \n\
-       ldq $31, 0($17)                                         \n\
-       ldq $31, 0($18)                                         \n\
-       ldq $31, 0($19)                                         \n\
-       ldq $31, 0($20)                                         \n\
-       ldq $31, 0($21)                                         \n\
-                                                               \n\
-       ldq $31, 64($17)                                        \n\
-       ldq $31, 64($18)                                        \n\
-       ldq $31, 64($19)                                        \n\
-       ldq $31, 64($20)                                        \n\
-       ldq $31, 64($21)                                        \n\
-                                                               \n\
-       ldq $31, 128($17)                                       \n\
-       ldq $31, 128($18)                                       \n\
-       ldq $31, 128($19)                                       \n\
-       ldq $31, 128($20)                                       \n\
-       ldq $31, 128($21)                                       \n\
-                                                               \n\
-       ldq $31, 192($17)                                       \n\
-       ldq $31, 192($18)                                       \n\
-       ldq $31, 192($19)                                       \n\
-       ldq $31, 192($20)                                       \n\
-       ldq $31, 192($21)                                       \n\
-       .align 4                                                \n\
-5:                                                             \n\
-       ldq $0,0($17)                                           \n\
-       ldq $1,0($18)                                           \n\
-       ldq $2,0($19)                                           \n\
-       ldq $3,0($20)                                           \n\
-                                                               \n\
-       ldq $4,0($21)                                           \n\
-       ldq $5,8($17)                                           \n\
-       ldq $6,8($18)                                           \n\
-       ldq $7,8($19)                                           \n\
-                                                               \n\
-       ldq $22,8($20)                                          \n\
-       ldq $23,8($21)                                          \n\
-       ldq $24,16($17)                                         \n\
-       ldq $25,16($18)                                         \n\
-                                                               \n\
-       ldq $27,16($19)                                         \n\
-       xor $0,$1,$1            # 6 cycles from $1 load         \n\
-       ldq $28,16($20)                                         \n\
-       xor $2,$3,$3            # 6 cycles from $3 load         \n\
-                                                               \n\
-       ldq $0,16($21)                                          \n\
-       xor $1,$3,$3                                            \n\
-       ldq $1,24($17)                                          \n\
-       xor $3,$4,$4            # 7 cycles from $4 load         \n\
-                                                               \n\
-       stq $4,0($17)                                           \n\
-       xor $5,$6,$6            # 7 cycles from $6 load         \n\
-       xor $7,$22,$22          # 7 cycles from $22 load        \n\
-       xor $6,$23,$23          # 7 cycles from $23 load        \n\
-                                                               \n\
-       ldq $2,24($18)                                          \n\
-       xor $22,$23,$23                                         \n\
-       ldq $3,24($19)                                          \n\
-       xor $24,$25,$25         # 8 cycles from $25 load        \n\
-                                                               \n\
-       stq $23,8($17)                                          \n\
-       xor $25,$27,$27         # 8 cycles from $27 load        \n\
-       ldq $4,24($20)                                          \n\
-       xor $28,$0,$0           # 7 cycles from $0 load         \n\
-                                                               \n\
-       ldq $5,24($21)                                          \n\
-       xor $27,$0,$0                                           \n\
-       ldq $6,32($17)                                          \n\
-       ldq $7,32($18)                                          \n\
-                                                               \n\
-       stq $0,16($17)                                          \n\
-       xor $1,$2,$2            # 6 cycles from $2 load         \n\
-       ldq $22,32($19)                                         \n\
-       xor $3,$4,$4            # 4 cycles from $4 load         \n\
-                                                               \n\
-       ldq $23,32($20)                                         \n\
-       xor $2,$4,$4                                            \n\
-       ldq $24,32($21)                                         \n\
-       ldq $25,40($17)                                         \n\
-                                                               \n\
-       ldq $27,40($18)                                         \n\
-       ldq $28,40($19)                                         \n\
-       ldq $0,40($20)                                          \n\
-       xor $4,$5,$5            # 7 cycles from $5 load         \n\
-                                                               \n\
-       stq $5,24($17)                                          \n\
-       xor $6,$7,$7            # 7 cycles from $7 load         \n\
-       ldq $1,40($21)                                          \n\
-       ldq $2,48($17)                                          \n\
-                                                               \n\
-       ldq $3,48($18)                                          \n\
-       xor $7,$22,$22          # 7 cycles from $22 load        \n\
-       ldq $4,48($19)                                          \n\
-       xor $23,$24,$24         # 6 cycles from $24 load        \n\
-                                                               \n\
-       ldq $5,48($20)                                          \n\
-       xor $22,$24,$24                                         \n\
-       ldq $6,48($21)                                          \n\
-       xor $25,$27,$27         # 7 cycles from $27 load        \n\
-                                                               \n\
-       stq $24,32($17)                                         \n\
-       xor $27,$28,$28         # 8 cycles from $28 load        \n\
-       ldq $7,56($17)                                          \n\
-       xor $0,$1,$1            # 6 cycles from $1 load         \n\
-                                                               \n\
-       ldq $22,56($18)                                         \n\
-       ldq $23,56($19)                                         \n\
-       ldq $24,56($20)                                         \n\
-       ldq $25,56($21)                                         \n\
-                                                               \n\
-       ldq $31,256($17)                                        \n\
-       xor $28,$1,$1                                           \n\
-       ldq $31,256($18)                                        \n\
-       xor $2,$3,$3            # 9 cycles from $3 load         \n\
-                                                               \n\
-       ldq $31,256($19)                                        \n\
-       xor $3,$4,$4            # 9 cycles from $4 load         \n\
-       ldq $31,256($20)                                        \n\
-       xor $5,$6,$6            # 8 cycles from $6 load         \n\
-                                                               \n\
-       stq $1,40($17)                                          \n\
-       xor $4,$6,$6                                            \n\
-       xor $7,$22,$22          # 7 cycles from $22 load        \n\
-       xor $23,$24,$24         # 6 cycles from $24 load        \n\
-                                                               \n\
-       stq $6,48($17)                                          \n\
-       xor $22,$24,$24                                         \n\
-       ldq $31,256($21)                                        \n\
-       xor $24,$25,$25         # 8 cycles from $25 load        \n\
-                                                               \n\
-       stq $25,56($17)                                         \n\
-       subq $16,1,$16                                          \n\
-       addq $21,64,$21                                         \n\
-       addq $20,64,$20                                         \n\
-                                                               \n\
-       addq $19,64,$19                                         \n\
-       addq $18,64,$18                                         \n\
-       addq $17,64,$17                                         \n\
-       bgt $16,5b                                              \n\
-                                                               \n\
-       ret                                                     \n\
-       .end xor_alpha_prefetch_5                               \n\
-");
-
-static struct xor_block_template xor_block_alpha = {
-       .name   = "alpha",
-       .do_2   = xor_alpha_2,
-       .do_3   = xor_alpha_3,
-       .do_4   = xor_alpha_4,
-       .do_5   = xor_alpha_5,
-};
-
-static struct xor_block_template xor_block_alpha_prefetch = {
-       .name   = "alpha prefetch",
-       .do_2   = xor_alpha_prefetch_2,
-       .do_3   = xor_alpha_prefetch_3,
-       .do_4   = xor_alpha_prefetch_4,
-       .do_5   = xor_alpha_prefetch_5,
-};
-
-/* For grins, also test the generic routines.  */
-#include <asm-generic/xor.h>
-
-#undef XOR_TRY_TEMPLATES
-#define XOR_TRY_TEMPLATES                              \
-       do {                                            \
-               xor_speed(&xor_block_8regs);            \
-               xor_speed(&xor_block_32regs);           \
-               xor_speed(&xor_block_alpha);            \
-               xor_speed(&xor_block_alpha_prefetch);   \
-       } while (0)
-
-/* Force the use of alpha_prefetch if EV6, as it is significantly
-   faster in the cold cache case.  */
-#define XOR_SELECT_TEMPLATE(FASTEST) \
-       (implver() == IMPLVER_EV6 ? &xor_block_alpha_prefetch : FASTEST)
diff --git a/include/asm-arm/plat-orion/cache-feroceon-l2.h b/include/asm-arm/plat-orion/cache-feroceon-l2.h
deleted file mode 100644 (file)
index ba4e016..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * include/asm-arm/plat-orion/cache-feroceon-l2.h
- *
- * Copyright (C) 2008 Marvell Semiconductor
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-extern void __init feroceon_l2_init(int l2_wt_override);
diff --git a/include/asm-arm/plat-orion/ehci-orion.h b/include/asm-arm/plat-orion/ehci-orion.h
deleted file mode 100644 (file)
index 7857056..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * include/asm-arm/plat-orion/ehci-orion.h
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __ASM_PLAT_ORION_EHCI_ORION_H
-#define __ASM_PLAT_ORION_EHCI_ORION_H
-
-#include <linux/mbus.h>
-
-struct orion_ehci_data {
-       struct mbus_dram_target_info    *dram;
-};
-
-
-#endif
diff --git a/include/asm-arm/plat-orion/irq.h b/include/asm-arm/plat-orion/irq.h
deleted file mode 100644 (file)
index 94aeed9..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * include/asm-arm/plat-orion/irq.h
- *
- * Marvell Orion SoC IRQ handling.
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __ASM_PLAT_ORION_IRQ_H
-#define __ASM_PLAT_ORION_IRQ_H
-
-void orion_irq_init(unsigned int irq_start, void __iomem *maskaddr);
-
-
-#endif
diff --git a/include/asm-arm/plat-orion/mv_xor.h b/include/asm-arm/plat-orion/mv_xor.h
deleted file mode 100644 (file)
index c349e8f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Marvell XOR platform device data definition file.
- */
-
-#ifndef __ASM_PLAT_ORION_MV_XOR_H
-#define __ASM_PLAT_ORION_MV_XOR_H
-
-#include <linux/dmaengine.h>
-#include <linux/mbus.h>
-
-#define MV_XOR_SHARED_NAME     "mv_xor_shared"
-#define MV_XOR_NAME            "mv_xor"
-
-struct mbus_dram_target_info;
-
-struct mv_xor_platform_shared_data {
-       struct mbus_dram_target_info    *dram;
-};
-
-struct mv_xor_platform_data {
-       struct platform_device          *shared;
-       int                             hw_id;
-       dma_cap_mask_t                  cap_mask;
-       size_t                          pool_size;
-};
-
-
-#endif
diff --git a/include/asm-arm/plat-orion/orion_nand.h b/include/asm-arm/plat-orion/orion_nand.h
deleted file mode 100644 (file)
index ad4ce94..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * include/asm-arm/plat-orion/orion_nand.h
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __ASM_PLAT_ORION_ORION_NAND_H
-#define __ASM_PLAT_ORION_ORION_NAND_H
-
-/*
- * Device bus NAND private data
- */
-struct orion_nand_data {
-       struct mtd_partition *parts;
-       u32 nr_parts;
-       u8 ale;         /* address line number connected to ALE */
-       u8 cle;         /* address line number connected to CLE */
-       u8 width;       /* buswidth */
-       u8 chip_delay;
-};
-
-
-#endif
diff --git a/include/asm-arm/plat-orion/pcie.h b/include/asm-arm/plat-orion/pcie.h
deleted file mode 100644 (file)
index e61b7bd..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * include/asm-arm/plat-orion/pcie.h
- *
- * Marvell Orion SoC PCIe handling.
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __ASM_PLAT_ORION_PCIE_H
-#define __ASM_PLAT_ORION_PCIE_H
-
-u32 orion_pcie_dev_id(void __iomem *base);
-u32 orion_pcie_rev(void __iomem *base);
-int orion_pcie_link_up(void __iomem *base);
-int orion_pcie_x4_mode(void __iomem *base);
-int orion_pcie_get_local_bus_nr(void __iomem *base);
-void orion_pcie_set_local_bus_nr(void __iomem *base, int nr);
-void orion_pcie_setup(void __iomem *base,
-                     struct mbus_dram_target_info *dram);
-int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus,
-                      u32 devfn, int where, int size, u32 *val);
-int orion_pcie_rd_conf_tlp(void __iomem *base, struct pci_bus *bus,
-                          u32 devfn, int where, int size, u32 *val);
-int orion_pcie_rd_conf_wa(void __iomem *wa_base, struct pci_bus *bus,
-                         u32 devfn, int where, int size, u32 *val);
-int orion_pcie_wr_conf(void __iomem *base, struct pci_bus *bus,
-                      u32 devfn, int where, int size, u32 val);
-
-
-#endif
diff --git a/include/asm-arm/plat-orion/time.h b/include/asm-arm/plat-orion/time.h
deleted file mode 100644 (file)
index 0e85cc8..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * include/asm-arm/plat-orion/time.h
- *
- * Marvell Orion SoC time handling.
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#ifndef __ASM_PLAT_ORION_TIME_H
-#define __ASM_PLAT_ORION_TIME_H
-
-void orion_time_init(unsigned int irq, unsigned int tclk);
-
-
-#endif
index 09f0b55..b2caa4b 100644 (file)
@@ -11,7 +11,7 @@
 */
 
 #ifndef __ASM_ARM_REGS_NAND
-#define __ASM_ARM_REGS_NAND "$Id: nand.h,v 1.3 2003/12/09 11:36:29 ben Exp $"
+#define __ASM_ARM_REGS_NAND
 
 
 #define S3C2410_NFREG(x) (x)
index b4366ea..cc0eedd 100644 (file)
@@ -12,7 +12,7 @@
 
 
 #ifndef __ASM_ARCH_REGS_TIMER_H
-#define __ASM_ARCH_REGS_TIMER_H "$Id: timer.h,v 1.4 2003/05/06 19:30:50 ben Exp $"
+#define __ASM_ARCH_REGS_TIMER_H
 
 #define S3C_TIMERREG(x) (S3C_VA_TIMER + (x))
 #define S3C_TIMERREG2(tmr,reg) S3C_TIMERREG((reg)+0x0c+((tmr)*0x0c))
index 1229f07..4938492 100644 (file)
@@ -12,7 +12,7 @@
 
 
 #ifndef __ASM_ARCH_REGS_WATCHDOG_H
-#define __ASM_ARCH_REGS_WATCHDOG_H "$Id: watchdog.h,v 1.2 2003/04/29 13:31:09 ben Exp $"
+#define __ASM_ARCH_REGS_WATCHDOG_H
 
 #define S3C_WDOGREG(x) ((x) + S3C_VA_WATCHDOG)
 
index 36de0b8..3cd1ec6 100644 (file)
@@ -21,11 +21,11 @@ extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no);
 
 extern void s3c2410_init_clocks(int xtal);
 
-extern  int s3c2410_baseclk_add(void);
-
 #else
 #define s3c2410_init_clocks NULL
 #define s3c2410_init_uarts NULL
 #define s3c2410_map_io NULL
 #define s3c2410_init NULL
 #endif
+
+extern int s3c2410_baseclk_add(void);
index 71f8fe7..606ecfd 100644 (file)
@@ -1,3 +1,3 @@
 include include/asm-generic/Kbuild.asm
 
-header-y += fixed_code.h
+unifdef-y += fixed_code.h
index 320aa5e..7ba70de 100644 (file)
@@ -56,37 +56,20 @@ extern void dump_bfin_process(struct pt_regs *regs);
 extern void dump_bfin_mem(struct pt_regs *regs);
 extern void dump_bfin_trace_buffer(void);
 
+/* init functions only */
 extern int init_arch_irq(void);
-extern void bfin_reset(void);
-extern void _cplb_hdr(void);
-/* Blackfin cache functions */
 extern void bfin_icache_init(void);
 extern void bfin_dcache_init(void);
-extern int read_iloc(void);
-extern int bfin_console_init(void);
-extern asmlinkage void lower_to_irq14(void);
-extern asmlinkage void bfin_return_from_exception(void);
 extern void init_exception_vectors(void);
-extern void init_dma(void);
 extern void program_IAR(void);
-extern void evt14_softirq(void);
+
+extern void bfin_reset(void);
+extern asmlinkage void lower_to_irq14(void);
+extern asmlinkage void bfin_return_from_exception(void);
+extern asmlinkage void evt14_softirq(void);
 extern asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs);
-extern void bfin_gpio_interrupt_setup(int irq, int irq_pfx, int type);
 extern int bfin_internal_set_wake(unsigned int irq, unsigned int state);
 
-extern asmlinkage void finish_atomic_sections (struct pt_regs *regs);
-extern char fixed_code_start;
-extern char fixed_code_end;
-extern int atomic_xchg32(void);
-extern int atomic_cas32(void);
-extern int atomic_add32(void);
-extern int atomic_sub32(void);
-extern int atomic_ior32(void);
-extern int atomic_and32(void);
-extern int atomic_xor32(void);
-extern void safe_user_instruction(void);
-extern void sigreturn_stub(void);
-
 extern void *l1_data_A_sram_alloc(size_t);
 extern void *l1_data_B_sram_alloc(size_t);
 extern void *l1_inst_sram_alloc(size_t);
@@ -110,11 +93,10 @@ extern void *sram_alloc_with_lsl(size_t, unsigned long);
 extern int sram_free_with_lsl(const void*);
 
 extern const char bfin_board_name[];
-extern unsigned long wall_jiffies;
 
 extern unsigned long bfin_sic_iwr[];
+extern unsigned vr_wakeup;
 extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */
-extern struct file_operations dpmc_fops;
 extern unsigned long _ramstart, _ramend, _rambase;
 extern unsigned long memory_start, memory_end, physical_mem_end;
 extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
@@ -122,8 +104,12 @@ extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
        _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[],
        _ebss_l2[], _l2_lma_start[];
 
-#ifdef CONFIG_MTD_UCLINUX
+/* only used when CONFIG_MTD_UCLINUX */
 extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;
+
+#ifdef CONFIG_BFIN_ICACHE_LOCK
+extern void cache_grab_lock(int way);
+extern void cache_lock(int way);
 #endif
 
 #endif
index de28e6e..96e8208 100644 (file)
@@ -11,7 +11,6 @@
 #ifndef __ASSEMBLY__
 
 void sleep_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
-void deep_sleep(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
 void hibernate_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
 void sleep_deeper(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
 void do_hibernate(int wakeup);
index 37db66c..32c4d49 100644 (file)
@@ -1,6 +1,28 @@
 /* This file defines the fixed addresses where userspace programs can find
    atomic code sequences.  */
 
+#ifndef __BFIN_ASM_FIXED_CODE_H__
+#define __BFIN_ASM_FIXED_CODE_H__
+
+#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
+#include <linux/linkage.h>
+#include <linux/ptrace.h>
+extern asmlinkage void finish_atomic_sections(struct pt_regs *regs);
+extern char fixed_code_start;
+extern char fixed_code_end;
+extern int atomic_xchg32(void);
+extern int atomic_cas32(void);
+extern int atomic_add32(void);
+extern int atomic_sub32(void);
+extern int atomic_ior32(void);
+extern int atomic_and32(void);
+extern int atomic_xor32(void);
+extern void safe_user_instruction(void);
+extern void sigreturn_stub(void);
+#endif
+#endif
+
 #define FIXED_CODE_START       0x400
 
 #define SIGRETURN_STUB         0x400
@@ -20,3 +42,5 @@
 #define SAFE_USER_INSTRUCTION   0x480
 
 #define FIXED_CODE_END         0x490
+
+#endif
index 193082d..ef46dc9 100644 (file)
 #define BFIN_DSUPBANKS 0
 #endif                         /*CONFIG_BFIN_DCACHE */
 
+/* Level 2 Memory - none */
+
+#define L2_START       0
+#define L2_LENGTH      0
+
 /* Scratch Pad Memory */
 
 #define L1_SCRATCH_START       0xFFB00000
index 995c06b..ed2034b 100644 (file)
@@ -47,7 +47,7 @@
 #define SDRAM_tRCD      TRCD_2
 #define SDRAM_tWR       TWR_2
 #endif
-#if (CONFIG_SCLK_HZ > 8955223) && (CONFIG_SCLK_HZ <= 104477612)
+#if (CONFIG_SCLK_HZ > 89552239) && (CONFIG_SCLK_HZ <= 104477612)
 #define SDRAM_tRP       TRP_2
 #define SDRAM_tRP_num   2
 #define SDRAM_tRAS      TRAS_5
index bd30b6f..581fc6e 100644 (file)
 
 #endif
 
+/* Level 2 Memory - none */
+
+#define L2_START       0
+#define L2_LENGTH      0
+
 /* Scratch Pad Memory */
 
 #define L1_SCRATCH_START       0xFFB00000
index 5c6726d..5078b66 100644 (file)
 
 #endif
 
+/* Level 2 Memory - none */
+
+#define L2_START       0
+#define L2_LENGTH      0
+
 /* Scratch Pad Memory */
 
 #define L1_SCRATCH_START       0xFFB00000
index ede210e..d39c396 100644 (file)
 #define bfin_read_SRAM_BASE_ADDRESS()        bfin_read32(SRAM_BASE_ADDRESS)
 #define bfin_write_SRAM_BASE_ADDRESS(val)    bfin_write32(SRAM_BASE_ADDRESS,val)
 #define bfin_read_DMEM_CONTROL()             bfin_read32(DMEM_CONTROL)
-#if ANOMALY_05000125
-extern void bfin_write_DMEM_CONTROL(unsigned int val);
-#else
 #define bfin_write_DMEM_CONTROL(val)         bfin_write32(DMEM_CONTROL,val)
-#endif
 #define bfin_read_DCPLB_STATUS()             bfin_read32(DCPLB_STATUS)
 #define bfin_write_DCPLB_STATUS(val)         bfin_write32(DCPLB_STATUS,val)
 #define bfin_read_DCPLB_FAULT_ADDR()         bfin_read32(DCPLB_FAULT_ADDR)
@@ -129,11 +125,7 @@ extern void bfin_write_DMEM_CONTROL(unsigned int val);
 #define DTEST_DATA3            0xFFE0040C
 */
 #define bfin_read_IMEM_CONTROL()             bfin_read32(IMEM_CONTROL)
-#if ANOMALY_05000125
-extern void bfin_write_IMEM_CONTROL(unsigned int val);
-#else
 #define bfin_write_IMEM_CONTROL(val)         bfin_write32(IMEM_CONTROL,val)
-#endif
 #define bfin_read_ICPLB_STATUS()             bfin_read32(ICPLB_STATUS)
 #define bfin_write_ICPLB_STATUS(val)         bfin_write32(ICPLB_STATUS,val)
 #define bfin_read_ICPLB_FAULT_ADDR()         bfin_read32(ICPLB_FAULT_ADDR)
index 42955d0..1e57b63 100644 (file)
 #define __NR_semtimedop                357
 #define __NR_timerfd_settime   358
 #define __NR_timerfd_gettime   359
+#define __NR_signalfd4         360
+#define __NR_eventfd2          361
+#define __NR_epoll_create1     362
+#define __NR_dup3              363
+#define __NR_pipe2             364
+#define __NR_inotify_init1     365
 
-#define __NR_syscall           360
+#define __NR_syscall           366
 #define NR_syscalls            __NR_syscall
 
 /* Old optional stuff no one actually uses */
index cdbab43..4314892 100644 (file)
@@ -16,7 +16,7 @@
  /* Maximum address we can use for the control code buffer */
 #define KEXEC_CONTROL_MEMORY_LIMIT (0x20000000)
 
-#define KEXEC_CONTROL_CODE_SIZE 4096
+#define KEXEC_CONTROL_PAGE_SIZE 4096
 
 /* The native architecture */
 #define KEXEC_ARCH KEXEC_ARCH_MIPS
index 22aa58c..dcc8120 100644 (file)
@@ -31,9 +31,6 @@
 #define ALIAS_TABLE_ENTRY_SIZE         2
 #define RLOOKUP_TABLE_ENTRY_SIZE       (sizeof(void *))
 
-/* helper macros */
-#define LOW_U32(x) ((x) & ((1ULL << 32)-1))
-
 /* Length of the MMIO region for the AMD IOMMU */
 #define MMIO_REGION_LENGTH       0x4000
 
@@ -69,6 +66,9 @@
 #define MMIO_EVT_TAIL_OFFSET   0x2018
 #define MMIO_STATUS_OFFSET     0x2020
 
+/* MMIO status bits */
+#define MMIO_STATUS_COM_WAIT_INT_MASK  0x04
+
 /* feature control bits */
 #define CONTROL_IOMMU_EN        0x00ULL
 #define CONTROL_HT_TUN_EN       0x01ULL
@@ -89,6 +89,7 @@
 #define CMD_INV_IOMMU_PAGES     0x03
 
 #define CMD_COMPL_WAIT_STORE_MASK      0x01
+#define CMD_COMPL_WAIT_INT_MASK                0x02
 #define CMD_INV_IOMMU_PAGES_SIZE_MASK  0x01
 #define CMD_INV_IOMMU_PAGES_PDE_MASK   0x02
 
 #define DEV_ENTRY_TRANSLATION   0x01
 #define DEV_ENTRY_IR            0x3d
 #define DEV_ENTRY_IW            0x3e
+#define DEV_ENTRY_NO_PAGE_FAULT        0x62
 #define DEV_ENTRY_EX            0x67
 #define DEV_ENTRY_SYSMGT1       0x68
 #define DEV_ENTRY_SYSMGT2       0x69
index bb06027..2c1cda0 100644 (file)
@@ -50,6 +50,7 @@ extern int geode_get_dev_base(unsigned int dev);
 #define MSR_PIC_YSEL_HIGH      0x51400021
 #define MSR_PIC_ZSEL_LOW       0x51400022
 #define MSR_PIC_ZSEL_HIGH      0x51400023
+#define MSR_PIC_IRQM_LPC       0x51400025
 
 #define MSR_MFGPT_IRQ          0x51400028
 #define MSR_MFGPT_NR           0x51400029
@@ -237,7 +238,7 @@ static inline u16 geode_mfgpt_read(int timer, u16 reg)
 }
 
 extern int geode_mfgpt_toggle_event(int timer, int cmp, int event, int enable);
-extern int geode_mfgpt_set_irq(int timer, int cmp, int irq, int enable);
+extern int geode_mfgpt_set_irq(int timer, int cmp, int *irq, int enable);
 extern int geode_mfgpt_alloc_timer(int timer, int domain);
 
 #define geode_mfgpt_setup_irq(t, c, i) geode_mfgpt_set_irq((t), (c), (i), 1)
index 6d3b210..56d00e3 100644 (file)
@@ -63,8 +63,6 @@ static inline int restore_fpu_checking(struct i387_fxsave_struct *fx)
 #else
                     : [fx] "cdaSDb" (fx), "m" (*fx), "0" (0));
 #endif
-       if (unlikely(err))
-               init_fpu(current);
        return err;
 }
 
index bf5d629..0f954dc 100644 (file)
@@ -21,7 +21,7 @@ extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys);
 
 #define build_mmio_read(name, size, type, reg, barrier) \
 static inline type name(const volatile void __iomem *addr) \
-{ type ret; asm volatile("mov" size " %1,%0":"=" reg (ret) \
+{ type ret; asm volatile("mov" size " %1,%0":reg (ret) \
 :"m" (*(volatile type __force *)addr) barrier); return ret; }
 
 #define build_mmio_write(name, size, type, reg, barrier) \
@@ -29,13 +29,13 @@ static inline void name(type val, volatile void __iomem *addr) \
 { asm volatile("mov" size " %0,%1": :reg (val), \
 "m" (*(volatile type __force *)addr) barrier); }
 
-build_mmio_read(readb, "b", unsigned char, "q", :"memory")
-build_mmio_read(readw, "w", unsigned short, "r", :"memory")
-build_mmio_read(readl, "l", unsigned int, "r", :"memory")
+build_mmio_read(readb, "b", unsigned char, "=q", :"memory")
+build_mmio_read(readw, "w", unsigned short, "=r", :"memory")
+build_mmio_read(readl, "l", unsigned int, "=r", :"memory")
 
-build_mmio_read(__readb, "b", unsigned char, "q", )
-build_mmio_read(__readw, "w", unsigned short, "r", )
-build_mmio_read(__readl, "l", unsigned int, "r", )
+build_mmio_read(__readb, "b", unsigned char, "=q", )
+build_mmio_read(__readw, "w", unsigned short, "=r", )
+build_mmio_read(__readl, "l", unsigned int, "=r", )
 
 build_mmio_write(writeb, "b", unsigned char, "q", :"memory")
 build_mmio_write(writew, "w", unsigned short, "r", :"memory")
@@ -59,8 +59,8 @@ build_mmio_write(__writel, "l", unsigned int, "r", )
 #define mmiowb() barrier()
 
 #ifdef CONFIG_X86_64
-build_mmio_read(readq, "q", unsigned long, "r", :"memory")
-build_mmio_read(__readq, "q", unsigned long, "r", )
+build_mmio_read(readq, "q", unsigned long, "=r", :"memory")
+build_mmio_read(__readq, "q", unsigned long, "=r", )
 build_mmio_write(writeq, "q", unsigned long, "r", :"memory")
 build_mmio_write(__writeq, "q", unsigned long, "r", )
 
index c0e52a1..4246ab7 100644 (file)
 # define PAGES_NR              17
 #endif
 
+#ifdef CONFIG_X86_32
+# define KEXEC_CONTROL_CODE_MAX_SIZE   2048
+#endif
+
 #ifndef __ASSEMBLY__
 
 #include <linux/string.h>
@@ -63,7 +67,7 @@
 /* Maximum address we can use for the control code buffer */
 # define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE
 
-# define KEXEC_CONTROL_CODE_SIZE       4096
+# define KEXEC_CONTROL_PAGE_SIZE       4096
 
 /* The native architecture */
 # define KEXEC_ARCH KEXEC_ARCH_386
@@ -79,7 +83,7 @@
 # define KEXEC_CONTROL_MEMORY_LIMIT     (0xFFFFFFFFFFUL)
 
 /* Allocate one page for the pdp and the second for the code */
-# define KEXEC_CONTROL_CODE_SIZE  (4096UL + 4096UL)
+# define KEXEC_CONTROL_PAGE_SIZE  (4096UL + 4096UL)
 
 /* The native architecture */
 # define KEXEC_ARCH KEXEC_ARCH_X86_64
index c1682b5..90bc410 100644 (file)
@@ -12,6 +12,7 @@
 #define MAP_NORESERVE  0x4000          /* don't check for reservations */
 #define MAP_POPULATE   0x8000          /* populate (prefault) pagetables */
 #define MAP_NONBLOCK   0x10000         /* do not block on IO */
+#define MAP_STACK      0x20000         /* give out an address that is best suited for process/thread stacks */
 
 #define MCL_CURRENT    1               /* lock all current mappings */
 #define MCL_FUTURE     2               /* lock all future mappings */
index b2298a2..5862e64 100644 (file)
@@ -97,10 +97,16 @@ static inline int pfn_valid(int pfn)
        reserve_bootmem_node(NODE_DATA(0), (addr), (size), (flags))
 #define alloc_bootmem(x) \
        __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_nopanic(x) \
+       __alloc_bootmem_node_nopanic(NODE_DATA(0), (x), SMP_CACHE_BYTES, \
+                               __pa(MAX_DMA_ADDRESS))
 #define alloc_bootmem_low(x) \
        __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, 0)
 #define alloc_bootmem_pages(x) \
        __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
+#define alloc_bootmem_pages_nopanic(x) \
+       __alloc_bootmem_node_nopanic(NODE_DATA(0), (x), PAGE_SIZE, \
+                               __pa(MAX_DMA_ADDRESS))
 #define alloc_bootmem_low_pages(x) \
        __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0)
 #define alloc_bootmem_node(pgdat, x)                                   \
index ac5fff4..549144d 100644 (file)
@@ -151,7 +151,7 @@ static inline void native_pgd_clear(pgd_t *pgd)
 #define VMALLOC_END      _AC(0xffffe1ffffffffff, UL)
 #define VMEMMAP_START   _AC(0xffffe20000000000, UL)
 #define MODULES_VADDR    _AC(0xffffffffa0000000, UL)
-#define MODULES_END      _AC(0xfffffffffff00000, UL)
+#define MODULES_END      _AC(0xffffffffff000000, UL)
 #define MODULES_LEN   (MODULES_END - MODULES_VADDR)
 
 #ifndef __ASSEMBLY__
index 5f58da4..4df3e2f 100644 (file)
@@ -728,6 +728,29 @@ extern unsigned long               boot_option_idle_override;
 extern unsigned long           idle_halt;
 extern unsigned long           idle_nomwait;
 
+/*
+ * on systems with caches, caches must be flashed as the absolute
+ * last instruction before going into a suspended halt.  Otherwise,
+ * dirty data can linger in the cache and become stale on resume,
+ * leading to strange errors.
+ *
+ * perform a variety of operations to guarantee that the compiler
+ * will not reorder instructions.  wbinvd itself is serializing
+ * so the processor will not reorder.
+ *
+ * Systems without cache can just go into halt.
+ */
+static inline void wbinvd_halt(void)
+{
+       mb();
+       /* check for clflush to determine if wbinvd is legal */
+       if (cpu_has_clflush)
+               asm volatile("cli; wbinvd; 1: hlt; jmp 1b" : : : "memory");
+       else
+               while (1)
+                       halt();
+}
+
 extern void enable_sep_cpu(void);
 extern int sysenter_setup(void);
 
index 4f9a986..e39c790 100644 (file)
@@ -65,7 +65,7 @@ static inline int __ticket_spin_is_contended(raw_spinlock_t *lock)
 {
        int tmp = ACCESS_ONCE(lock->slock);
 
-       return (((tmp >> 8) & 0xff) - (tmp & 0xff)) > 1;
+       return (((tmp >> 8) - tmp) & 0xff) > 1;
 }
 
 static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock)
@@ -127,7 +127,7 @@ static inline int __ticket_spin_is_contended(raw_spinlock_t *lock)
 {
        int tmp = ACCESS_ONCE(lock->slock);
 
-       return (((tmp >> 16) & 0xffff) - (tmp & 0xffff)) > 1;
+       return (((tmp >> 16) - tmp) & 0xffff) > 1;
 }
 
 static __always_inline void __ticket_spin_lock(raw_spinlock_t *lock)
index 327f606..7d97067 100644 (file)
@@ -250,6 +250,8 @@ unifdef-y += isdn.h
 unifdef-y += isdnif.h
 unifdef-y += isdn_divertif.h
 unifdef-y += isdn_ppp.h
+unifdef-y += ivtv.h
+unifdef-y += ivtvfb.h
 unifdef-y += joystick.h
 unifdef-y += kdev_t.h
 unifdef-y += kd.h
index 0267384..9d1fe30 100644 (file)
@@ -503,8 +503,19 @@ extern const kernel_cap_t __cap_init_eff_set;
 
 kernel_cap_t cap_set_effective(const kernel_cap_t pE_new);
 
-int capable(int cap);
-int __capable(struct task_struct *t, int cap);
+/**
+ * has_capability - Determine if a task has a superior capability available
+ * @t: The task in question
+ * @cap: The capability to be tested for
+ *
+ * Return true if the specified task has the given superior capability
+ * currently in effect, false if not.
+ *
+ * Note that this does not set PF_SUPERPRIV on the task.
+ */
+#define has_capability(t, cap) (security_capable((t), (cap)) == 0)
+
+extern int capable(int cap);
 
 #endif /* __KERNEL__ */
 
index 57faa60..02ef883 100644 (file)
@@ -49,6 +49,8 @@ extern unsigned long wait_for_completion_timeout(struct completion *x,
                                                   unsigned long timeout);
 extern unsigned long wait_for_completion_interruptible_timeout(
                        struct completion *x, unsigned long timeout);
+extern bool try_wait_for_completion(struct completion *x);
+extern bool completion_done(struct completion *x);
 
 extern void complete(struct completion *);
 extern void complete_all(struct completion *);
@@ -56,48 +58,4 @@ extern void complete_all(struct completion *);
 #define INIT_COMPLETION(x)     ((x).done = 0)
 
 
-/**
- *     try_wait_for_completion - try to decrement a completion without blocking
- *     @x:     completion structure
- *
- *     Returns: 0 if a decrement cannot be done without blocking
- *              1 if a decrement succeeded.
- *
- *     If a completion is being used as a counting completion,
- *     attempt to decrement the counter without blocking. This
- *     enables us to avoid waiting if the resource the completion
- *     is protecting is not available.
- */
-static inline bool try_wait_for_completion(struct completion *x)
-{
-       int ret = 1;
-
-       spin_lock_irq(&x->wait.lock);
-       if (!x->done)
-               ret = 0;
-       else
-               x->done--;
-       spin_unlock_irq(&x->wait.lock);
-       return ret;
-}
-
-/**
- *     completion_done - Test to see if a completion has any waiters
- *     @x:     completion structure
- *
- *     Returns: 0 if there are waiters (wait_for_completion() in progress)
- *              1 if there are no waiters.
- *
- */
-static inline bool completion_done(struct completion *x)
-{
-       int ret = 1;
-
-       spin_lock_irq(&x->wait.lock);
-       if (!x->done)
-               ret = 0;
-       spin_unlock_irq(&x->wait.lock);
-       return ret;
-}
-
 #endif
index f368d04..bb38406 100644 (file)
@@ -98,6 +98,27 @@ static inline void tracer_disable(void)
 #endif
 }
 
+/* Ftrace disable/restore without lock. Some synchronization mechanism
+ * must be used to prevent ftrace_enabled to be changed between
+ * disable/restore. */
+static inline int __ftrace_enabled_save(void)
+{
+#ifdef CONFIG_FTRACE
+       int saved_ftrace_enabled = ftrace_enabled;
+       ftrace_enabled = 0;
+       return saved_ftrace_enabled;
+#else
+       return 0;
+#endif
+}
+
+static inline void __ftrace_enabled_restore(int enabled)
+{
+#ifdef CONFIG_FTRACE
+       ftrace_enabled = enabled;
+#endif
+}
+
 #ifdef CONFIG_FRAME_POINTER
 /* TODO: need to fix this for ARM */
 # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
index 794b8da..17ca64b 100644 (file)
 #ifndef __LINUX_IVTV_H__
 #define __LINUX_IVTV_H__
 
-#ifdef __KERNEL__
-#include <linux/compiler.h> /* need __user */
-#else
-#define __user
-#endif
+#include <linux/compiler.h>
 #include <linux/types.h>
 
 /* ivtv knows several distinct output modes: MPEG streaming,
index e980ba6..e20af47 100644 (file)
 #ifndef __LINUX_IVTVFB_H__
 #define __LINUX_IVTVFB_H__
 
-#ifdef __KERNEL__
-#include <linux/compiler.h> /* need __user */
-#else
-#define __user
-#endif
+#include <linux/compiler.h>
 #include <linux/types.h>
 
 /* Framebuffer external API */
index 32110ce..17f76fc 100644 (file)
@@ -25,8 +25,8 @@
 #error KEXEC_CONTROL_MEMORY_LIMIT not defined
 #endif
 
-#ifndef KEXEC_CONTROL_CODE_SIZE
-#error KEXEC_CONTROL_CODE_SIZE not defined
+#ifndef KEXEC_CONTROL_PAGE_SIZE
+#error KEXEC_CONTROL_PAGE_SIZE not defined
 #endif
 
 #ifndef KEXEC_ARCH
index fa65160..72a15dc 100644 (file)
@@ -73,7 +73,7 @@ extern unsigned int kobjsize(const void *objp);
 #endif
 
 /*
- * vm_flags..
+ * vm_flags in vm_area_struct, see mm_types.h.
  */
 #define VM_READ                0x00000001      /* currently active flags */
 #define VM_WRITE       0x00000002
index 386edbe..bf33413 100644 (file)
@@ -113,7 +113,7 @@ struct vm_area_struct {
        struct vm_area_struct *vm_next;
 
        pgprot_t vm_page_prot;          /* Access permissions of this VMA. */
-       unsigned long vm_flags;         /* Flags, listed below. */
+       unsigned long vm_flags;         /* Flags, see mm.h. */
 
        struct rb_node vm_rb;
 
index b93b541..988e55f 100644 (file)
@@ -59,6 +59,7 @@ extern void machine_crash_shutdown(struct pt_regs *);
  * Architecture independent implemenations of sys_reboot commands.
  */
 
+extern void kernel_restart_prepare(char *cmd);
 extern void kernel_restart(char *cmd);
 extern void kernel_halt(void);
 extern void kernel_power_off(void);
index fd96e7f..2ee5ecf 100644 (file)
@@ -46,8 +46,8 @@ struct audit_krule;
  */
 extern int cap_capable(struct task_struct *tsk, int cap);
 extern int cap_settime(struct timespec *ts, struct timezone *tz);
-extern int cap_ptrace(struct task_struct *parent, struct task_struct *child,
-                     unsigned int mode);
+extern int cap_ptrace_may_access(struct task_struct *child, unsigned int mode);
+extern int cap_ptrace_traceme(struct task_struct *parent);
 extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted);
 extern int cap_capset_check(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted);
 extern void cap_capset_set(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted);
@@ -1157,17 +1157,24 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
  *     @alter contains the flag indicating whether changes are to be made.
  *     Return 0 if permission is granted.
  *
- * @ptrace:
- *     Check permission before allowing the @parent process to trace the
+ * @ptrace_may_access:
+ *     Check permission before allowing the current process to trace the
  *     @child process.
  *     Security modules may also want to perform a process tracing check
  *     during an execve in the set_security or apply_creds hooks of
  *     binprm_security_ops if the process is being traced and its security
  *     attributes would be changed by the execve.
- *     @parent contains the task_struct structure for parent process.
- *     @child contains the task_struct structure for child process.
+ *     @child contains the task_struct structure for the target process.
  *     @mode contains the PTRACE_MODE flags indicating the form of access.
  *     Return 0 if permission is granted.
+ * @ptrace_traceme:
+ *     Check that the @parent process has sufficient permission to trace the
+ *     current process before allowing the current process to present itself
+ *     to the @parent process for tracing.
+ *     The parent process will still have to undergo the ptrace_may_access
+ *     checks before it is allowed to trace this one.
+ *     @parent contains the task_struct structure for debugger process.
+ *     Return 0 if permission is granted.
  * @capget:
  *     Get the @effective, @inheritable, and @permitted capability sets for
  *     the @target process.  The hook may also perform permission checking to
@@ -1287,8 +1294,8 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
 struct security_operations {
        char name[SECURITY_NAME_MAX + 1];
 
-       int (*ptrace) (struct task_struct *parent, struct task_struct *child,
-                      unsigned int mode);
+       int (*ptrace_may_access) (struct task_struct *child, unsigned int mode);
+       int (*ptrace_traceme) (struct task_struct *parent);
        int (*capget) (struct task_struct *target,
                       kernel_cap_t *effective,
                       kernel_cap_t *inheritable, kernel_cap_t *permitted);
@@ -1560,8 +1567,8 @@ extern struct dentry *securityfs_create_dir(const char *name, struct dentry *par
 extern void securityfs_remove(struct dentry *dentry);
 
 /* Security operations */
-int security_ptrace(struct task_struct *parent, struct task_struct *child,
-                   unsigned int mode);
+int security_ptrace_may_access(struct task_struct *child, unsigned int mode);
+int security_ptrace_traceme(struct task_struct *parent);
 int security_capget(struct task_struct *target,
                    kernel_cap_t *effective,
                    kernel_cap_t *inheritable,
@@ -1742,11 +1749,15 @@ static inline int security_init(void)
        return 0;
 }
 
-static inline int security_ptrace(struct task_struct *parent,
-                                 struct task_struct *child,
-                                 unsigned int mode)
+static inline int security_ptrace_may_access(struct task_struct *child,
+                                            unsigned int mode)
+{
+       return cap_ptrace_may_access(child, mode);
+}
+
+static inline int security_ptrace_traceme(struct task_struct *child)
 {
-       return cap_ptrace(parent, child, mode);
+       return cap_ptrace_traceme(parent);
 }
 
 static inline int security_capget(struct task_struct *target,
index c634350..2ce8207 100644 (file)
@@ -217,11 +217,11 @@ struct platform_hibernation_ops {
 #ifdef CONFIG_HIBERNATION
 /* kernel/power/snapshot.c */
 extern void __register_nosave_region(unsigned long b, unsigned long e, int km);
-static inline void register_nosave_region(unsigned long b, unsigned long e)
+static inline void __init register_nosave_region(unsigned long b, unsigned long e)
 {
        __register_nosave_region(b, e, 0);
 }
-static inline void register_nosave_region_late(unsigned long b, unsigned long e)
+static inline void __init register_nosave_region_late(unsigned long b, unsigned long e)
 {
        __register_nosave_region(b, e, 1);
 }
index e3579cb..0cbec74 100644 (file)
@@ -331,6 +331,8 @@ extern int tty_write_room(struct tty_struct *tty);
 extern void tty_driver_flush_buffer(struct tty_struct *tty);
 extern void tty_throttle(struct tty_struct *tty);
 extern void tty_unthrottle(struct tty_struct *tty);
+extern int tty_do_resize(struct tty_struct *tty, struct tty_struct *real_tty,
+                                               struct winsize *ws);
 
 extern int is_current_pgrp_orphaned(void);
 extern struct pid *tty_get_pgrp(struct tty_struct *tty);
index e1065ac..16d2794 100644 (file)
  *
  *     Optional: If not provided then the write method is called under
  *     the atomic write lock to keep it serialized with the ldisc.
+ *
+ * int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty,
+ *                             unsigned int rows, unsigned int cols);
+ *
+ *     Called when a termios request is issued which changes the
+ *     requested terminal geometry.
+ *
+ *     Optional: the default action is to update the termios structure
+ *     without error. This is usually the correct behaviour. Drivers should
+ *     not force errors here if they are not resizable objects (eg a serial
+ *     line). See tty_do_resize() if you need to wrap the standard method
+ *     in your own logic - the usual case.
  */
 
 #include <linux/fs.h>
@@ -206,6 +218,8 @@ struct tty_operations {
        int (*tiocmget)(struct tty_struct *tty, struct file *file);
        int (*tiocmset)(struct tty_struct *tty, struct file *file,
                        unsigned int set, unsigned int clear);
+       int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty,
+                               struct winsize *ws);
 #ifdef CONFIG_CONSOLE_POLL
        int (*poll_init)(struct tty_driver *driver, int line, char *options);
        int (*poll_get_char)(struct tty_driver *driver, int line);
index e466bd5..e65a6be 100644 (file)
  */
 #ifndef __LINUX_VIDEODEV2_H
 #define __LINUX_VIDEODEV2_H
+
 #ifdef __KERNEL__
 #include <linux/time.h>     /* need struct timeval */
-#include <linux/compiler.h> /* need __user */
 #else
-#define __user
 #include <sys/time.h>
 #endif
+#include <linux/compiler.h>
 #include <linux/ioctl.h>
 #include <linux/types.h>
 
index 364789a..328eb40 100644 (file)
@@ -4,9 +4,9 @@
 #include <linux/spinlock.h>
 #include <asm/page.h>          /* pgprot_t */
 
-struct vm_area_struct;
+struct vm_area_struct;         /* vma defining user mapping in mm_types.h */
 
-/* bits in vm_struct->flags */
+/* bits in flags of vmalloc's vm_struct below */
 #define VM_IOREMAP     0x00000001      /* ioremap() and friends */
 #define VM_ALLOC       0x00000002      /* vmalloc() */
 #define VM_MAP         0x00000004      /* vmap()ed pages */
index 1c78d56..1cbd0a7 100644 (file)
@@ -35,7 +35,6 @@ extern int fg_console, last_console, want_console;
 int vc_allocate(unsigned int console);
 int vc_cons_allocated(unsigned int console);
 int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines);
-int vc_lock_resize(struct vc_data *vc, unsigned int cols, unsigned int lines);
 void vc_deallocate(unsigned int console);
 void reset_palette(struct vc_data *vc);
 void do_blank_screen(int entering_gfx);
index b678803..c11da38 100644 (file)
@@ -558,17 +558,6 @@ config SYSCTL_SYSCALL
 
          If unsure say Y here.
 
-config SYSCTL_SYSCALL_CHECK
-       bool "Sysctl checks" if EMBEDDED
-       depends on SYSCTL_SYSCALL
-       default y
-       ---help---
-         sys_sysctl uses binary paths that have been found challenging
-         to properly maintain and use. This enables checks that help
-         you to keep things correct.
-
-         If unsure say Y here.
-
 config KALLSYMS
         bool "Load all symbols for debugging/ksymoops" if EMBEDDED
         default y
index 0101e84..33e51e7 100644 (file)
@@ -486,17 +486,22 @@ asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data)
        return ret;
 }
 
-int __capable(struct task_struct *t, int cap)
+/**
+ * capable - Determine if the current task has a superior capability in effect
+ * @cap: The capability to be tested for
+ *
+ * Return true if the current task has the given superior capability currently
+ * available for use, false if not.
+ *
+ * This sets PF_SUPERPRIV on the task if the capability is available on the
+ * assumption that it's about to be used.
+ */
+int capable(int cap)
 {
-       if (security_capable(t, cap) == 0) {
-               t->flags |= PF_SUPERPRIV;
+       if (has_capability(current, cap)) {
+               current->flags |= PF_SUPERPRIV;
                return 1;
        }
        return 0;
 }
-
-int capable(int cap)
-{
-       return __capable(current, cap);
-}
 EXPORT_SYMBOL(capable);
index c8a4370..59f3f0d 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/slab.h>
 #include <linux/fs.h>
 #include <linux/kexec.h>
-#include <linux/spinlock.h>
+#include <linux/mutex.h>
 #include <linux/list.h>
 #include <linux/highmem.h>
 #include <linux/syscalls.h>
@@ -77,7 +77,7 @@ int kexec_should_crash(struct task_struct *p)
  *
  * The code for the transition from the current kernel to the
  * the new kernel is placed in the control_code_buffer, whose size
- * is given by KEXEC_CONTROL_CODE_SIZE.  In the best case only a single
+ * is given by KEXEC_CONTROL_PAGE_SIZE.  In the best case only a single
  * page of memory is necessary, but some architectures require more.
  * Because this memory must be identity mapped in the transition from
  * virtual to physical addresses it must live in the range
@@ -242,7 +242,7 @@ static int kimage_normal_alloc(struct kimage **rimage, unsigned long entry,
         */
        result = -ENOMEM;
        image->control_code_page = kimage_alloc_control_pages(image,
-                                          get_order(KEXEC_CONTROL_CODE_SIZE));
+                                          get_order(KEXEC_CONTROL_PAGE_SIZE));
        if (!image->control_code_page) {
                printk(KERN_ERR "Could not allocate control_code_buffer\n");
                goto out;
@@ -317,7 +317,7 @@ static int kimage_crash_alloc(struct kimage **rimage, unsigned long entry,
         */
        result = -ENOMEM;
        image->control_code_page = kimage_alloc_control_pages(image,
-                                          get_order(KEXEC_CONTROL_CODE_SIZE));
+                                          get_order(KEXEC_CONTROL_PAGE_SIZE));
        if (!image->control_code_page) {
                printk(KERN_ERR "Could not allocate control_code_buffer\n");
                goto out;
@@ -924,19 +924,14 @@ static int kimage_load_segment(struct kimage *image,
  */
 struct kimage *kexec_image;
 struct kimage *kexec_crash_image;
-/*
- * A home grown binary mutex.
- * Nothing can wait so this mutex is safe to use
- * in interrupt context :)
- */
-static int kexec_lock;
+
+static DEFINE_MUTEX(kexec_mutex);
 
 asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
                                struct kexec_segment __user *segments,
                                unsigned long flags)
 {
        struct kimage **dest_image, *image;
-       int locked;
        int result;
 
        /* We only trust the superuser with rebooting the system. */
@@ -972,8 +967,7 @@ asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
         *
         * KISS: always take the mutex.
         */
-       locked = xchg(&kexec_lock, 1);
-       if (locked)
+       if (!mutex_trylock(&kexec_mutex))
                return -EBUSY;
 
        dest_image = &kexec_image;
@@ -1015,8 +1009,7 @@ asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
        image = xchg(dest_image, image);
 
 out:
-       locked = xchg(&kexec_lock, 0); /* Release the mutex */
-       BUG_ON(!locked);
+       mutex_unlock(&kexec_mutex);
        kimage_free(image);
 
        return result;
@@ -1063,10 +1056,7 @@ asmlinkage long compat_sys_kexec_load(unsigned long entry,
 
 void crash_kexec(struct pt_regs *regs)
 {
-       int locked;
-
-
-       /* Take the kexec_lock here to prevent sys_kexec_load
+       /* Take the kexec_mutex here to prevent sys_kexec_load
         * running on one cpu from replacing the crash kernel
         * we are using after a panic on a different cpu.
         *
@@ -1074,8 +1064,7 @@ void crash_kexec(struct pt_regs *regs)
         * of memory the xchg(&kexec_crash_image) would be
         * sufficient.  But since I reuse the memory...
         */
-       locked = xchg(&kexec_lock, 1);
-       if (!locked) {
+       if (mutex_trylock(&kexec_mutex)) {
                if (kexec_crash_image) {
                        struct pt_regs fixed_regs;
                        crash_setup_regs(&fixed_regs, regs);
@@ -1083,8 +1072,7 @@ void crash_kexec(struct pt_regs *regs)
                        machine_crash_shutdown(&fixed_regs);
                        machine_kexec(kexec_crash_image);
                }
-               locked = xchg(&kexec_lock, 0);
-               BUG_ON(!locked);
+               mutex_unlock(&kexec_mutex);
        }
 }
 
@@ -1426,25 +1414,23 @@ static int __init crash_save_vmcoreinfo_init(void)
 
 module_init(crash_save_vmcoreinfo_init)
 
-/**
- *     kernel_kexec - reboot the system
- *
- *     Move into place and start executing a preloaded standalone
- *     executable.  If nothing was preloaded return an error.
+/*
+ * Move into place and start executing a preloaded standalone
+ * executable.  If nothing was preloaded return an error.
  */
 int kernel_kexec(void)
 {
        int error = 0;
 
-       if (xchg(&kexec_lock, 1))
+       if (!mutex_trylock(&kexec_mutex))
                return -EBUSY;
        if (!kexec_image) {
                error = -EINVAL;
                goto Unlock;
        }
 
-       if (kexec_image->preserve_context) {
 #ifdef CONFIG_KEXEC_JUMP
+       if (kexec_image->preserve_context) {
                mutex_lock(&pm_mutex);
                pm_prepare_console();
                error = freeze_processes();
@@ -1459,6 +1445,7 @@ int kernel_kexec(void)
                error = disable_nonboot_cpus();
                if (error)
                        goto Resume_devices;
+               device_pm_lock();
                local_irq_disable();
                /* At this point, device_suspend() has been called,
                 * but *not* device_power_down(). We *must*
@@ -1470,26 +1457,22 @@ int kernel_kexec(void)
                error = device_power_down(PMSG_FREEZE);
                if (error)
                        goto Enable_irqs;
-               save_processor_state();
+       } else
 #endif
-       } else {
-               blocking_notifier_call_chain(&reboot_notifier_list,
-                                            SYS_RESTART, NULL);
-               system_state = SYSTEM_RESTART;
-               device_shutdown();
-               sysdev_shutdown();
+       {
+               kernel_restart_prepare(NULL);
                printk(KERN_EMERG "Starting new kernel\n");
                machine_shutdown();
        }
 
        machine_kexec(kexec_image);
 
-       if (kexec_image->preserve_context) {
 #ifdef CONFIG_KEXEC_JUMP
-               restore_processor_state();
+       if (kexec_image->preserve_context) {
                device_power_up(PMSG_RESTORE);
  Enable_irqs:
                local_irq_enable();
+               device_pm_unlock();
                enable_nonboot_cpus();
  Resume_devices:
                device_resume(PMSG_RESTORE);
@@ -1499,11 +1482,10 @@ int kernel_kexec(void)
  Restore_console:
                pm_restore_console();
                mutex_unlock(&pm_mutex);
-#endif
        }
+#endif
 
  Unlock:
-       xchg(&kexec_lock, 0);
-
+       mutex_unlock(&kexec_mutex);
        return error;
 }
index 1aa91fd..77fa776 100644 (file)
@@ -1759,11 +1759,10 @@ static void check_chain_key(struct task_struct *curr)
                hlock = curr->held_locks + i;
                if (chain_key != hlock->prev_chain_key) {
                        debug_locks_off();
-                       printk("hm#1, depth: %u [%u], %016Lx != %016Lx\n",
+                       WARN(1, "hm#1, depth: %u [%u], %016Lx != %016Lx\n",
                                curr->lockdep_depth, i,
                                (unsigned long long)chain_key,
                                (unsigned long long)hlock->prev_chain_key);
-                       WARN_ON(1);
                        return;
                }
                id = hlock->class_idx - 1;
@@ -1778,11 +1777,10 @@ static void check_chain_key(struct task_struct *curr)
        }
        if (chain_key != curr->curr_chain_key) {
                debug_locks_off();
-               printk("hm#2, depth: %u [%u], %016Lx != %016Lx\n",
+               WARN(1, "hm#2, depth: %u [%u], %016Lx != %016Lx\n",
                        curr->lockdep_depth, i,
                        (unsigned long long)chain_key,
                        (unsigned long long)curr->curr_chain_key);
-               WARN_ON(1);
        }
 #endif
 }
index 55db193..56b1969 100644 (file)
@@ -50,8 +50,21 @@ extern unsigned int nr_process_chains;
 extern unsigned int max_lockdep_depth;
 extern unsigned int max_recursion_depth;
 
+#ifdef CONFIG_PROVE_LOCKING
 extern unsigned long lockdep_count_forward_deps(struct lock_class *);
 extern unsigned long lockdep_count_backward_deps(struct lock_class *);
+#else
+static inline unsigned long
+lockdep_count_forward_deps(struct lock_class *class)
+{
+       return 0;
+}
+static inline unsigned long
+lockdep_count_backward_deps(struct lock_class *class)
+{
+       return 0;
+}
+#endif
 
 #ifdef CONFIG_DEBUG_LOCKDEP
 /*
index fa19aee..4b194d3 100644 (file)
@@ -82,7 +82,6 @@ static void print_name(struct seq_file *m, struct lock_class *class)
 
 static int l_show(struct seq_file *m, void *v)
 {
-       unsigned long nr_forward_deps, nr_backward_deps;
        struct lock_class *class = v;
        struct lock_list *entry;
        char c1, c2, c3, c4;
@@ -96,11 +95,10 @@ static int l_show(struct seq_file *m, void *v)
 #ifdef CONFIG_DEBUG_LOCKDEP
        seq_printf(m, " OPS:%8ld", class->ops);
 #endif
-       nr_forward_deps = lockdep_count_forward_deps(class);
-       seq_printf(m, " FD:%5ld", nr_forward_deps);
-
-       nr_backward_deps = lockdep_count_backward_deps(class);
-       seq_printf(m, " BD:%5ld", nr_backward_deps);
+#ifdef CONFIG_PROVE_LOCKING
+       seq_printf(m, " FD:%5ld", lockdep_count_forward_deps(class));
+       seq_printf(m, " BD:%5ld", lockdep_count_backward_deps(class));
+#endif
 
        get_usage_chars(class, &c1, &c2, &c3, &c4);
        seq_printf(m, " %c%c%c%c", c1, c2, c3, c4);
@@ -325,7 +323,9 @@ static int lockdep_stats_show(struct seq_file *m, void *v)
                if (class->usage_mask & LOCKF_ENABLED_HARDIRQS_READ)
                        nr_hardirq_read_unsafe++;
 
+#ifdef CONFIG_PROVE_LOCKING
                sum_forward_deps += lockdep_count_forward_deps(class);
+#endif
        }
 #ifdef CONFIG_DEBUG_LOCKDEP
        DEBUG_LOCKS_WARN_ON(debug_atomic_read(&nr_unused_locks) != nr_unused);
index 082b3fc..356699a 100644 (file)
@@ -140,7 +140,7 @@ int __ptrace_may_access(struct task_struct *task, unsigned int mode)
        if (!dumpable && !capable(CAP_SYS_PTRACE))
                return -EPERM;
 
-       return security_ptrace(current, task, mode);
+       return security_ptrace_may_access(task, mode);
 }
 
 bool ptrace_may_access(struct task_struct *task, unsigned int mode)
@@ -499,8 +499,7 @@ repeat:
                        goto repeat;
                }
 
-               ret = security_ptrace(current->parent, current,
-                                     PTRACE_MODE_ATTACH);
+               ret = security_ptrace_traceme(current->parent);
 
                /*
                 * Set the ptrace bit in the process ptrace flags.
index d601fb0..9a1ddb8 100644 (file)
@@ -808,9 +808,9 @@ const_debug unsigned int sysctl_sched_nr_migrate = 32;
 
 /*
  * ratelimit for updating the group shares.
- * default: 0.5ms
+ * default: 0.25ms
  */
-const_debug unsigned int sysctl_sched_shares_ratelimit = 500000;
+unsigned int sysctl_sched_shares_ratelimit = 250000;
 
 /*
  * period over which we measure -rt task cpu usage in us.
@@ -4669,6 +4669,52 @@ int __sched wait_for_completion_killable(struct completion *x)
 }
 EXPORT_SYMBOL(wait_for_completion_killable);
 
+/**
+ *     try_wait_for_completion - try to decrement a completion without blocking
+ *     @x:     completion structure
+ *
+ *     Returns: 0 if a decrement cannot be done without blocking
+ *              1 if a decrement succeeded.
+ *
+ *     If a completion is being used as a counting completion,
+ *     attempt to decrement the counter without blocking. This
+ *     enables us to avoid waiting if the resource the completion
+ *     is protecting is not available.
+ */
+bool try_wait_for_completion(struct completion *x)
+{
+       int ret = 1;
+
+       spin_lock_irq(&x->wait.lock);
+       if (!x->done)
+               ret = 0;
+       else
+               x->done--;
+       spin_unlock_irq(&x->wait.lock);
+       return ret;
+}
+EXPORT_SYMBOL(try_wait_for_completion);
+
+/**
+ *     completion_done - Test to see if a completion has any waiters
+ *     @x:     completion structure
+ *
+ *     Returns: 0 if there are waiters (wait_for_completion() in progress)
+ *              1 if there are no waiters.
+ *
+ */
+bool completion_done(struct completion *x)
+{
+       int ret = 1;
+
+       spin_lock_irq(&x->wait.lock);
+       if (!x->done)
+               ret = 0;
+       spin_unlock_irq(&x->wait.lock);
+       return ret;
+}
+EXPORT_SYMBOL(completion_done);
+
 static long __sched
 sleep_on_common(wait_queue_head_t *q, int state, long timeout)
 {
@@ -5740,6 +5786,8 @@ static inline void sched_init_granularity(void)
                sysctl_sched_latency = limit;
 
        sysctl_sched_wakeup_granularity *= factor;
+
+       sysctl_sched_shares_ratelimit *= factor;
 }
 
 #ifdef CONFIG_SMP
@@ -8462,8 +8510,8 @@ struct task_group *sched_create_group(struct task_group *parent)
        WARN_ON(!parent); /* root should already exist */
 
        tg->parent = parent;
-       list_add_rcu(&tg->siblings, &parent->children);
        INIT_LIST_HEAD(&tg->children);
+       list_add_rcu(&tg->siblings, &parent->children);
        spin_unlock_irqrestore(&task_group_lock, flags);
 
        return tg;
index 6163e4c..998ba54 100644 (file)
@@ -298,7 +298,7 @@ static void __disable_runtime(struct rq *rq)
                        struct rt_rq *iter = sched_rt_period_rt_rq(rt_b, i);
                        s64 diff;
 
-                       if (iter == rt_rq)
+                       if (iter == rt_rq || iter->rt_runtime == RUNTIME_INF)
                                continue;
 
                        spin_lock(&iter->rt_runtime_lock);
index 44baeea..29ab207 100644 (file)
@@ -290,7 +290,6 @@ void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass)
        spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_);
        LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock);
 }
-
 EXPORT_SYMBOL(_spin_lock_nested);
 
 unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass)
@@ -312,7 +311,6 @@ unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclas
 #endif
        return flags;
 }
-
 EXPORT_SYMBOL(_spin_lock_irqsave_nested);
 
 void __lockfunc _spin_lock_nest_lock(spinlock_t *lock,
@@ -322,7 +320,6 @@ void __lockfunc _spin_lock_nest_lock(spinlock_t *lock,
        spin_acquire_nest(&lock->dep_map, 0, 0, nest_lock, _RET_IP_);
        LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock);
 }
-
 EXPORT_SYMBOL(_spin_lock_nest_lock);
 
 #endif
index c018580..3dacb00 100644 (file)
@@ -274,7 +274,7 @@ void emergency_restart(void)
 }
 EXPORT_SYMBOL_GPL(emergency_restart);
 
-static void kernel_restart_prepare(char *cmd)
+void kernel_restart_prepare(char *cmd)
 {
        blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd);
        system_state = SYSTEM_RESTART;
index 800ac84..8b5a7d3 100644 (file)
@@ -693,6 +693,14 @@ config LATENCYTOP
          Enable this option if you want to use the LatencyTOP tool
          to find out which userspace is blocking on what kernel operations.
 
+config SYSCTL_SYSCALL_CHECK
+       bool "Sysctl checks"
+       depends on SYSCTL_SYSCALL
+       ---help---
+         sys_sysctl uses binary paths that have been found challenging
+         to properly maintain and use. This enables checks that help
+         you to keep things correct.
+
 source kernel/trace/Kconfig
 
 config PROVIDE_OHCI1394_DMA_INIT
index 4af15d0..e023c68 100644 (file)
@@ -473,7 +473,7 @@ find_block:
                                goto find_block;
                        }
 
-               if (bdata->last_end_off &&
+               if (bdata->last_end_off & (PAGE_SIZE - 1) &&
                                PFN_DOWN(bdata->last_end_off) + 1 == sidx)
                        start_off = ALIGN(bdata->last_end_off, align);
                else
index 8a5467e..64e5b4b 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/module.h>
 #include <linux/notifier.h>
 #include <linux/memcontrol.h>
+#include <linux/security.h>
 
 int sysctl_panic_on_oom;
 int sysctl_oom_kill_allocating_task;
@@ -128,7 +129,8 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
         * Superuser processes are usually more important, so we make it
         * less likely that we kill those.
         */
-       if (__capable(p, CAP_SYS_ADMIN) || __capable(p, CAP_SYS_RESOURCE))
+       if (has_capability(p, CAP_SYS_ADMIN) ||
+           has_capability(p, CAP_SYS_RESOURCE))
                points /= 4;
 
        /*
@@ -137,7 +139,7 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
         * tend to only have this flag set on applications they think
         * of as important.
         */
-       if (__capable(p, CAP_SYS_RAWIO))
+       if (has_capability(p, CAP_SYS_RAWIO))
                points /= 4;
 
        /*
index 63d10da..2458748 100644 (file)
@@ -811,7 +811,8 @@ struct security_operations default_security_ops = {
 
 void security_fixup_ops(struct security_operations *ops)
 {
-       set_to_cap_if_null(ops, ptrace);
+       set_to_cap_if_null(ops, ptrace_may_access);
+       set_to_cap_if_null(ops, ptrace_traceme);
        set_to_cap_if_null(ops, capget);
        set_to_cap_if_null(ops, capset_check);
        set_to_cap_if_null(ops, capset_set);
index 4afbece..e4c4b3f 100644 (file)
@@ -63,14 +63,24 @@ int cap_settime(struct timespec *ts, struct timezone *tz)
        return 0;
 }
 
-int cap_ptrace (struct task_struct *parent, struct task_struct *child,
-               unsigned int mode)
+int cap_ptrace_may_access(struct task_struct *child, unsigned int mode)
 {
        /* Derived from arch/i386/kernel/ptrace.c:sys_ptrace. */
-       if (!cap_issubset(child->cap_permitted, parent->cap_permitted) &&
-           !__capable(parent, CAP_SYS_PTRACE))
-               return -EPERM;
-       return 0;
+       if (cap_issubset(child->cap_permitted, current->cap_permitted))
+               return 0;
+       if (capable(CAP_SYS_PTRACE))
+               return 0;
+       return -EPERM;
+}
+
+int cap_ptrace_traceme(struct task_struct *parent)
+{
+       /* Derived from arch/i386/kernel/ptrace.c:sys_ptrace. */
+       if (cap_issubset(current->cap_permitted, parent->cap_permitted))
+               return 0;
+       if (has_capability(parent, CAP_SYS_PTRACE))
+               return 0;
+       return -EPERM;
 }
 
 int cap_capget (struct task_struct *target, kernel_cap_t *effective,
@@ -534,7 +544,7 @@ int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid,
 static inline int cap_safe_nice(struct task_struct *p)
 {
        if (!cap_issubset(p->cap_permitted, current->cap_permitted) &&
-           !__capable(current, CAP_SYS_NICE))
+           !capable(CAP_SYS_NICE))
                return -EPERM;
        return 0;
 }
index be0ebec..c3f68b5 100644 (file)
@@ -72,7 +72,8 @@ static int rootplug_bprm_check_security (struct linux_binprm *bprm)
 
 static struct security_operations rootplug_security_ops = {
        /* Use the capability functions for some of the hooks */
-       .ptrace =                       cap_ptrace,
+       .ptrace_may_access =            cap_ptrace_may_access,
+       .ptrace_traceme =               cap_ptrace_traceme,
        .capget =                       cap_capget,
        .capset_check =                 cap_capset_check,
        .capset_set =                   cap_capset_set,
index ff70687..3a4b4f5 100644 (file)
@@ -127,10 +127,14 @@ int register_security(struct security_operations *ops)
 
 /* Security operations */
 
-int security_ptrace(struct task_struct *parent, struct task_struct *child,
-                   unsigned int mode)
+int security_ptrace_may_access(struct task_struct *child, unsigned int mode)
 {
-       return security_ops->ptrace(parent, child, mode);
+       return security_ops->ptrace_may_access(child, mode);
+}
+
+int security_ptrace_traceme(struct task_struct *parent)
+{
+       return security_ops->ptrace_traceme(parent);
 }
 
 int security_capget(struct task_struct *target,
index 3ae9bec..03fc6a8 100644 (file)
@@ -1738,24 +1738,34 @@ static inline u32 file_to_av(struct file *file)
 
 /* Hook functions begin here. */
 
-static int selinux_ptrace(struct task_struct *parent,
-                         struct task_struct *child,
-                         unsigned int mode)
+static int selinux_ptrace_may_access(struct task_struct *child,
+                                    unsigned int mode)
 {
        int rc;
 
-       rc = secondary_ops->ptrace(parent, child, mode);
+       rc = secondary_ops->ptrace_may_access(child, mode);
        if (rc)
                return rc;
 
        if (mode == PTRACE_MODE_READ) {
-               struct task_security_struct *tsec = parent->security;
+               struct task_security_struct *tsec = current->security;
                struct task_security_struct *csec = child->security;
                return avc_has_perm(tsec->sid, csec->sid,
                                    SECCLASS_FILE, FILE__READ, NULL);
        }
 
-       return task_has_perm(parent, child, PROCESS__PTRACE);
+       return task_has_perm(current, child, PROCESS__PTRACE);
+}
+
+static int selinux_ptrace_traceme(struct task_struct *parent)
+{
+       int rc;
+
+       rc = secondary_ops->ptrace_traceme(parent);
+       if (rc)
+               return rc;
+
+       return task_has_perm(parent, current, PROCESS__PTRACE);
 }
 
 static int selinux_capget(struct task_struct *target, kernel_cap_t *effective,
@@ -5346,7 +5356,8 @@ static int selinux_key_getsecurity(struct key *key, char **_buffer)
 static struct security_operations selinux_ops = {
        .name =                         "selinux",
 
-       .ptrace =                       selinux_ptrace,
+       .ptrace_may_access =            selinux_ptrace_may_access,
+       .ptrace_traceme =               selinux_ptrace_traceme,
        .capget =                       selinux_capget,
        .capset_check =                 selinux_capset_check,
        .capset_set =                   selinux_capset_set,
index 1b40e55..87d7541 100644 (file)
@@ -87,27 +87,46 @@ struct inode_smack *new_inode_smack(char *smack)
  */
 
 /**
- * smack_ptrace - Smack approval on ptrace
- * @ptp: parent task pointer
+ * smack_ptrace_may_access - Smack approval on PTRACE_ATTACH
  * @ctp: child task pointer
  *
  * Returns 0 if access is OK, an error code otherwise
  *
  * Do the capability checks, and require read and write.
  */
-static int smack_ptrace(struct task_struct *ptp, struct task_struct *ctp,
-                       unsigned int mode)
+static int smack_ptrace_may_access(struct task_struct *ctp, unsigned int mode)
 {
        int rc;
 
-       rc = cap_ptrace(ptp, ctp, mode);
+       rc = cap_ptrace_may_access(ctp, mode);
        if (rc != 0)
                return rc;
 
-       rc = smk_access(ptp->security, ctp->security, MAY_READWRITE);
-       if (rc != 0 && __capable(ptp, CAP_MAC_OVERRIDE))
+       rc = smk_access(current->security, ctp->security, MAY_READWRITE);
+       if (rc != 0 && capable(CAP_MAC_OVERRIDE))
                return 0;
+       return rc;
+}
+
+/**
+ * smack_ptrace_traceme - Smack approval on PTRACE_TRACEME
+ * @ptp: parent task pointer
+ *
+ * Returns 0 if access is OK, an error code otherwise
+ *
+ * Do the capability checks, and require read and write.
+ */
+static int smack_ptrace_traceme(struct task_struct *ptp)
+{
+       int rc;
+
+       rc = cap_ptrace_traceme(ptp);
+       if (rc != 0)
+               return rc;
 
+       rc = smk_access(ptp->security, current->security, MAY_READWRITE);
+       if (rc != 0 && has_capability(ptp, CAP_MAC_OVERRIDE))
+               return 0;
        return rc;
 }
 
@@ -923,7 +942,7 @@ static int smack_file_send_sigiotask(struct task_struct *tsk,
         */
        file = container_of(fown, struct file, f_owner);
        rc = smk_access(file->f_security, tsk->security, MAY_WRITE);
-       if (rc != 0 && __capable(tsk, CAP_MAC_OVERRIDE))
+       if (rc != 0 && has_capability(tsk, CAP_MAC_OVERRIDE))
                return 0;
        return rc;
 }
@@ -1164,12 +1183,12 @@ static int smack_task_wait(struct task_struct *p)
         * account for the smack labels having gotten to
         * be different in the first place.
         *
-        * This breaks the strict subjet/object access
+        * This breaks the strict subject/object access
         * control ideal, taking the object's privilege
         * state into account in the decision as well as
         * the smack value.
         */
-       if (capable(CAP_MAC_OVERRIDE) || __capable(p, CAP_MAC_OVERRIDE))
+       if (capable(CAP_MAC_OVERRIDE) || has_capability(p, CAP_MAC_OVERRIDE))
                return 0;
 
        return rc;
@@ -2016,9 +2035,6 @@ static int smack_setprocattr(struct task_struct *p, char *name,
 {
        char *newsmack;
 
-       if (!__capable(p, CAP_MAC_ADMIN))
-               return -EPERM;
-
        /*
         * Changing another process' Smack value is too dangerous
         * and supports no sane use case.
@@ -2026,6 +2042,9 @@ static int smack_setprocattr(struct task_struct *p, char *name,
        if (p != current)
                return -EPERM;
 
+       if (!capable(CAP_MAC_ADMIN))
+               return -EPERM;
+
        if (value == NULL || size == 0 || size >= SMK_LABELLEN)
                return -EINVAL;
 
@@ -2552,7 +2571,8 @@ static void smack_release_secctx(char *secdata, u32 seclen)
 struct security_operations smack_ops = {
        .name =                         "smack",
 
-       .ptrace =                       smack_ptrace,
+       .ptrace_may_access =            smack_ptrace_may_access,
+       .ptrace_traceme =               smack_ptrace_traceme,
        .capget =                       cap_capget,
        .capset_check =                 cap_capset_check,
        .capset_set =                   cap_capset_set,
@@ -2729,4 +2749,3 @@ static __init int smack_init(void)
  * all processes and objects when they are created.
  */
 security_initcall(smack_init);
-
index f7d95b2..31f52d3 100644 (file)
@@ -845,7 +845,7 @@ config SND_VIRTUOSO
        select SND_OXYGEN_LIB
        help
          Say Y here to include support for sound cards based on the
-         Asus AV100/AV200 chips, i.e., Xonar D2, DX and D2X.
+         Asus AV100/AV200 chips, i.e., Xonar D1, DX, D2 and D2X.
 
          To compile this driver as a module, choose M here: the module
          will be called snd-virtuoso.
index 9a2c16b..01d7b75 100644 (file)
  */
 
 /*
- * Xonar DX
- * --------
+ * Xonar D1/DX
+ * -----------
  *
  * CMI8788:
  *
  * I²C <-> CS4398 (front)
  *     <-> CS4362A (surround, center/LFE, back)
  *
- * GPI 0 <- external power present
+ * GPI 0 <- external power present (DX only)
  *
  * GPIO 0 -> enable output to speakers
  * GPIO 1 -> enable front panel I/O
@@ -96,6 +96,7 @@ MODULE_PARM_DESC(enable, "enable card");
 enum {
        MODEL_D2,
        MODEL_D2X,
+       MODEL_D1,
        MODEL_DX,
 };
 
@@ -103,6 +104,7 @@ static struct pci_device_id xonar_ids[] __devinitdata = {
        { OXYGEN_PCI_SUBID(0x1043, 0x8269), .driver_data = MODEL_D2 },
        { OXYGEN_PCI_SUBID(0x1043, 0x8275), .driver_data = MODEL_DX },
        { OXYGEN_PCI_SUBID(0x1043, 0x82b7), .driver_data = MODEL_D2X },
+       { OXYGEN_PCI_SUBID(0x1043, 0x834f), .driver_data = MODEL_D1 },
        { }
 };
 MODULE_DEVICE_TABLE(pci, xonar_ids);
@@ -313,15 +315,12 @@ static void cs43xx_init(struct oxygen *chip)
        cs4362a_write(chip, 0x01, CS4362A_CPEN);
 }
 
-static void xonar_dx_init(struct oxygen *chip)
+static void xonar_d1_init(struct oxygen *chip)
 {
        struct xonar_data *data = chip->model_data;
 
        data->anti_pop_delay = 800;
        data->output_enable_bit = GPIO_DX_OUTPUT_ENABLE;
-       data->ext_power_reg = OXYGEN_GPI_DATA;
-       data->ext_power_int_reg = OXYGEN_GPI_INTERRUPT_MASK;
-       data->ext_power_bit = GPI_DX_EXT_POWER;
        data->cs4398_fm = CS4398_FM_SINGLE | CS4398_DEM_NONE | CS4398_DIF_LJUST;
        data->cs4362a_fm = CS4362A_FM_SINGLE |
                CS4362A_ATAPI_B_R | CS4362A_ATAPI_A_L;
@@ -345,6 +344,16 @@ static void xonar_dx_init(struct oxygen *chip)
        snd_component_add(chip->card, "CS5361");
 }
 
+static void xonar_dx_init(struct oxygen *chip)
+{
+       struct xonar_data *data = chip->model_data;
+
+       data->ext_power_reg = OXYGEN_GPI_DATA;
+       data->ext_power_int_reg = OXYGEN_GPI_INTERRUPT_MASK;
+       data->ext_power_bit = GPI_DX_EXT_POWER;
+       xonar_d1_init(chip);
+}
+
 static void xonar_cleanup(struct oxygen *chip)
 {
        struct xonar_data *data = chip->model_data;
@@ -352,7 +361,7 @@ static void xonar_cleanup(struct oxygen *chip)
        oxygen_clear_bits16(chip, OXYGEN_GPIO_DATA, data->output_enable_bit);
 }
 
-static void xonar_dx_cleanup(struct oxygen *chip)
+static void xonar_d1_cleanup(struct oxygen *chip)
 {
        xonar_cleanup(chip);
        cs4362a_write(chip, 0x01, CS4362A_PDN | CS4362A_CPEN);
@@ -365,7 +374,7 @@ static void xonar_d2_resume(struct oxygen *chip)
        xonar_enable_output(chip);
 }
 
-static void xonar_dx_resume(struct oxygen *chip)
+static void xonar_d1_resume(struct oxygen *chip)
 {
        cs43xx_init(chip);
        xonar_enable_output(chip);
@@ -513,7 +522,7 @@ static const struct snd_kcontrol_new front_panel_switch = {
        .put = front_panel_put,
 };
 
-static void xonar_dx_ac97_switch(struct oxygen *chip,
+static void xonar_d1_ac97_switch(struct oxygen *chip,
                                 unsigned int reg, unsigned int mute)
 {
        if (reg == AC97_LINE) {
@@ -536,7 +545,7 @@ static int xonar_d2_control_filter(struct snd_kcontrol_new *template)
        return 0;
 }
 
-static int xonar_dx_control_filter(struct snd_kcontrol_new *template)
+static int xonar_d1_control_filter(struct snd_kcontrol_new *template)
 {
        if (!strncmp(template->name, "CD Capture ", 11))
                return 1; /* no CD input */
@@ -548,7 +557,7 @@ static int xonar_mixer_init(struct oxygen *chip)
        return snd_ctl_add(chip->card, snd_ctl_new1(&alt_switch, chip));
 }
 
-static int xonar_dx_mixer_init(struct oxygen *chip)
+static int xonar_d1_mixer_init(struct oxygen *chip)
 {
        return snd_ctl_add(chip->card, snd_ctl_new1(&front_panel_switch, chip));
 }
@@ -615,23 +624,51 @@ static const struct oxygen_model xonar_models[] = {
                .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
                .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
        },
+       [MODEL_D1] = {
+               .shortname = "Xonar D1",
+               .longname = "Asus Virtuoso 100",
+               .chip = "AV200",
+               .owner = THIS_MODULE,
+               .init = xonar_d1_init,
+               .control_filter = xonar_d1_control_filter,
+               .mixer_init = xonar_d1_mixer_init,
+               .cleanup = xonar_d1_cleanup,
+               .suspend = xonar_d1_cleanup,
+               .resume = xonar_d1_resume,
+               .set_dac_params = set_cs43xx_params,
+               .set_adc_params = set_cs53x1_params,
+               .update_dac_volume = update_cs43xx_volume,
+               .update_dac_mute = update_cs43xx_mute,
+               .ac97_switch = xonar_d1_ac97_switch,
+               .dac_tlv = cs4362a_db_scale,
+               .model_data_size = sizeof(struct xonar_data),
+               .pcm_dev_cfg = PLAYBACK_0_TO_I2S |
+                              PLAYBACK_1_TO_SPDIF |
+                              CAPTURE_0_FROM_I2S_2,
+               .dac_channels = 8,
+               .dac_volume_min = 0,
+               .dac_volume_max = 127,
+               .function_flags = OXYGEN_FUNCTION_2WIRE,
+               .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
+               .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
+       },
        [MODEL_DX] = {
                .shortname = "Xonar DX",
                .longname = "Asus Virtuoso 100",
                .chip = "AV200",
                .owner = THIS_MODULE,
                .init = xonar_dx_init,
-               .control_filter = xonar_dx_control_filter,
-               .mixer_init = xonar_dx_mixer_init,
-               .cleanup = xonar_dx_cleanup,
-               .suspend = xonar_dx_cleanup,
-               .resume = xonar_dx_resume,
+               .control_filter = xonar_d1_control_filter,
+               .mixer_init = xonar_d1_mixer_init,
+               .cleanup = xonar_d1_cleanup,
+               .suspend = xonar_d1_cleanup,
+               .resume = xonar_d1_resume,
                .set_dac_params = set_cs43xx_params,
                .set_adc_params = set_cs53x1_params,
                .update_dac_volume = update_cs43xx_volume,
                .update_dac_mute = update_cs43xx_mute,
                .gpio_changed = xonar_gpio_changed,
-               .ac97_switch = xonar_dx_ac97_switch,
+               .ac97_switch = xonar_d1_ac97_switch,
                .dac_tlv = cs4362a_db_scale,
                .model_data_size = sizeof(struct xonar_data),
                .pcm_dev_cfg = PLAYBACK_0_TO_I2S |
index 3ecce51..e44153f 100644 (file)
@@ -82,7 +82,7 @@ static const u16 wm8990_reg[] = {
        0x0003,     /* R35 - ClassD1 */
        0x0000,     /* R36 */
        0x0100,     /* R37 - ClassD3 */
-       0x0000,     /* R38 */
+       0x0079,     /* R38 - ClassD4 */
        0x0000,     /* R39 - Input Mixer1 */
        0x0000,     /* R40 - Input Mixer2 */
        0x0000,     /* R41 - Input Mixer3 */
@@ -311,11 +311,15 @@ SOC_SINGLE("Speaker Mode Switch", WM8990_CLASSD1,
        WM8990_CDMODE_BIT, 1, 0),
 
 SOC_SINGLE("Speaker Output Attenuation Volume", WM8990_SPEAKER_VOLUME,
-       WM8990_SPKVOL_SHIFT, WM8990_SPKVOL_MASK, 0),
+       WM8990_SPKATTN_SHIFT, WM8990_SPKATTN_MASK, 0),
 SOC_SINGLE("Speaker DC Boost Volume", WM8990_CLASSD3,
        WM8990_DCGAIN_SHIFT, WM8990_DCGAIN_MASK, 0),
 SOC_SINGLE("Speaker AC Boost Volume", WM8990_CLASSD3,
        WM8990_ACGAIN_SHIFT, WM8990_ACGAIN_MASK, 0),
+SOC_SINGLE_TLV("Speaker Volume", WM8990_CLASSD4,
+       WM8990_SPKVOL_SHIFT, WM8990_SPKVOL_MASK, 0, out_pga_tlv),
+SOC_SINGLE("Speaker ZC Switch", WM8990_CLASSD4,
+       WM8990_SPKZC_SHIFT, WM8990_SPKZC_MASK, 0),
 
 SOC_WM899X_OUTPGA_SINGLE_R_TLV("Left DAC Digital Volume",
        WM8990_LEFT_DAC_DIGITAL_VOLUME,
@@ -920,7 +924,7 @@ static const struct snd_soc_dapm_route audio_map[] = {
        {"SPKMIX", "SPKMIX Left Mixer PGA Switch", "LOPGA"},
        {"SPKMIX", "SPKMIX Right Mixer PGA Switch", "ROPGA"},
        {"SPKMIX", "SPKMIX Right DAC Switch", "Right DAC"},
-       {"SPKMIX", "SPKMIX Left DAC Switch", "Right DAC"},
+       {"SPKMIX", "SPKMIX Left DAC Switch", "Left DAC"},
 
        /* LONMIX */
        {"LONMIX", "LONMIX Left Mixer PGA Switch", "LOPGA"},
index 6bea574..0a08325 100644 (file)
@@ -54,6 +54,7 @@
 #define WM8990_SPEAKER_VOLUME                   0x22
 #define WM8990_CLASSD1                          0x23
 #define WM8990_CLASSD3                          0x25
+#define WM8990_CLASSD4                          0x26
 #define WM8990_INPUT_MIXER1                     0x27
 #define WM8990_INPUT_MIXER2                     0x28
 #define WM8990_INPUT_MIXER3                     0x29
 /*
  * R34 (0x22) - Speaker Volume
  */
-#define WM8990_SPKVOL_MASK                      0x0003  /* SPKVOL - [1:0] */
-#define WM8990_SPKVOL_SHIFT                    0
+#define WM8990_SPKATTN_MASK                      0x0003  /* SPKATTN - [1:0] */
+#define WM8990_SPKATTN_SHIFT                    0
 
 /*
  * R35 (0x23) - ClassD1
 #define WM8990_DCGAIN_SHIFT                    3
 #define WM8990_ACGAIN_MASK                      0x0007  /* ACGAIN - [2:0] */
 #define WM8990_ACGAIN_SHIFT                    0
+
+/*
+ * R38 (0x26) - ClassD4
+ */
+#define WM8990_SPKZC_MASK                       0x0001  /* SPKZC */
+#define WM8990_SPKZC_SHIFT                           7  /* SPKZC */
+#define WM8990_SPKVOL_MASK                      0x007F  /* SPKVOL - [6:0] */
+#define WM8990_SPKVOL_SHIFT                          0  /* SPKVOL - [6:0] */
+
 /*
  * R39 (0x27) - Input Mixer1
  */